Procedure Modules › Concatenating Fields (CULLUS53) › Helpful Hints
Helpful Hints
- CULLUS53 automatically eliminates trailing blanks attached to individual data segments.
- Blank fields and fields with zero length are ignored.
- Data returned to the receiving field is compressed. Data segments are separated by a blank.
- The receiving field is padded with blanks to the right of the last significant character. If you don't want the field padded with blanks, make the length of the receiving field equal to the sum of the length of the data segments plus one space between each field, but not more than 132.
Example
This example concatenates name and address fields to produce a mailing list.
The following code:
- Defines input data fields
- Defines work fields to receive the name (FULL-NAME) and the address (CITY-STATE-ZIP)
- Issues a CALL to CULLUS53 to concatenate the elements of the name and another CALL to concatenate the elements of the address
INPUT 80 F 400
REC NAME 6 26
REC FIRST-NAME 6 10
REC LAST-NAME 16 10
REC STREET 26 20
REC CITY 46 15
REC STATE 61 2
REC ZIP 63 5
093CULLUS53
090 FULL-NAME ' '
090 CITY-STATE-ZIP ' '
090 BLANK ' '
09510001 FULL-NAME
09520001 STREET
09530001 CITY-STATE-ZIP
09540001 BLANK
097010 CALL US53 (FIRST-NAME,10,LAST-NAME,10,BLANK,1,
*FULL-NAME,23)
097025 CALL US53 (CITY 15 STATE 2 ZIP 5
* CITY-STATE-ZIP 24)
REPORT NO. 09 CULLUS53 mm/dd/yy PAGE 1
AMOS JOHNSON
22651 MASS AVENUE
SAN FRANCISCO CA 09801
BRUCE THORPE
11002 PEACHTREE LA
ATLANTA GA 76543
Copyright © 2014 CA.
All rights reserved.
|
|