View previous topic :: View next topic
Author
Message
ilakkia Warnings : 1 New User Joined: 17 May 2008Posts: 28 Location: chennai
I have two files, the last record is Trailer Record.
Please note that my files also contain UHDR and UTRL.
The trailer record has three count at positions 16, 26 and 36.
Each count is declare as Z(8)9 inside the program.
i need to add the counts at corresponding positons and place it in another
file. Another thing is the new file should contain TRAILER RECORD starting from positon 1 to 14.
i used a control card as follows,
SORT FIELDS=COPY
INCLUDE COND=(01,07,CH,EQ,C'TRAILER')
SUM FIELDS=(16,9,26,9,36,9), FORMAT=ZD
This didnt work. Please help me on this.
Back to top
CICS Guy Senior Member Joined: 18 Jul 2007Posts: 2146 Location: At my coffee table
Please post your sysins and all your sysouts....
Please post an example of your input and the 'expected' output....
Back to top
ilakkia Warnings : 1 New User Joined: 17 May 2008Posts: 28 Location: chennai
Input File1:
189899195021B61L91460 03836W1031602 8Z 6712WTR
189899195021B61L91461 03836W1031602 8Z 6712WTR
189899657072G31I63195 1110131081602 8Z 0000BSY
TRAILER RECORD 1 1 1
Input File2:
18989979131LU81L91462 74347R5861601 8Z 6714DUG
28989979131LU81L91462 PROSHARES TRUST
TRAILER RECORD 1 1 0
Sort Cord Used:
INCLUDE COND=(01,07,CH,EQ,C'TRAILER')
SORT FIELDS=(1,14,CH,A)
SUM FIELDS=(16,9,ZD,26,9,ZD,36,9,ZD)
Note:
1.The trailer record is populated via three counters TL-T1COUNT, TL-T2COUNT and TL-T3COUNT respectively.
2.TL-T1COUNT, TL-T2COUNT and TL-T1COUNT fields are declared as Z(8)9
inside the cobol program.
Hence I used ZD.
This worked fine and got an output as below:
Actual Output:
TRAILER RECORD 000000002 000000002 000000001
Now my need is to suppress the padded zeros. Please Help me on this.
Desired Output:
TRAILER RECORD 2 2 1
Back to top
Skolusu Senior Member Joined: 07 Dec 2007Posts: 2205 Location: San Jose
Ilakkia,
Try the following DFSORT control cards
Code:
//SYSIN DD *
INCLUDE COND=(1,7,CH,EQ,C'TRAILER')
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('TRAILER RECORD',
16:TOT=(16,09,ZD,M10,LENGTH=9),
26:TOT=(26,09,ZD,M10,LENGTH=9),
36:TOT=(36,09,ZD,M10,LENGTH=9))
/*
Back to top
Please enable JavaScript!