View previous topic :: View next topic
Author
Message
Keanehelp New User Joined: 27 May 2008Posts: 71 Location: USA, CA.
Hi,
We have to convert a flate sequential file into a report and we are using SORT utility for this like..
Input: - 111222222|111 222222|666666666|XXXX|CHUNG |000000000016.00|0000250007.88
Sort Card used --
001X,1/01:'ACCT# ',1X,'|',1X,'OFF-ACCT ',1X,'|',1X, HEADER
'CUSIP ',1X,'|',1X,'SYMBOL',1X,'|',1X,
'SHORT-NAME ',1X,'|',1X,'DEBIT AMOUNT ',1X,'|',1X,
'MM BALANCE ',
001X,1/01:'---------------------------------------------',
46:'---------------------------------------------'),
OUTREC=(1:1,9,10:C' | ',13:11,10,23:C' | ',26:22,9,35:C' | ',
38:32,4,42:C' | ',47:37,11,58:C' | ',
61:49,15,76:C' | ',79:65,12,42X),
TRAILER1=(10:'TOTAL NO OF ACCOUNTS: ',1X,COUNT)
The final output is like
-
-----------------------------------------------------------------------
ACCT# | OFF-ACCT | CUSIP | SYMBOL | SHORT-NAME | DEBIT AMOUNT | MM BALANCE
-----------------------------------------------------------------------
111222222 | 111 222222 | 666666666 | XXXX | CHUNG | 000000000016.00 | 000025007.88
The question is --> We want that leading zeroes should be supressed in the amount field and amount field should also appear in nnn,nnn,nnn.nn format.
Please suggest
Back to top
saiprasadh Active User Joined: 20 Sep 2006Posts: 154 Location: US
try below mentioned Sort Card
Code:
//STEP002 EXEC PGM=SORT
//*
//SORTIN DD *
111222222|111 222222|666666666|XXXX|CHUNG |000000001016.00|0000250007.88
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT,REMOVECC,
HEADER1=(1:C'ACCT# ',1X,'|',1X,C'OFF-ACCT ',1X,'|',1X,
C'CUSIP ',1X,'|',1X,C'SYMBOL',1X,'|',1X,
C'SHORT-NAME ',1X,'|',1X,C'DEBIT AMOUNT ',1X,'|',1X,
C'MM BALANCE ',/,
1:C'---------------------------------------------',
46:C'---------------------------------------------'),
OUTREC=(1:1,9,10:C' | ',13:11,10,23:C' | ',26:22,9,35:C' | ',
38:32,4,42:C' | ',45:37,06,51:C' | ',
54:44,15,UFF,EDIT=(III,III,III,IIT.TT),72:C' | ',75:60,13,42X),
TRAILER1=(10:'TOTAL NO OF ACCOUNTS: ',1X,COUNT)
/*
Output:
Code:
ACCT# | OFF-ACCT | CUSIP | SYMBOL | SHORT-NAME | DEBIT AMOUNT | MM BALANCE
-------------------------------------------------------------------------------------------
111222222 | 111 222222 | 666666666 | XXXX | CHUNG | 1,016.00 | 0000250007.88
TOTAL NO OF ACCOUNTS: 1
Back to top
Keanehelp New User Joined: 27 May 2008Posts: 71 Location: USA, CA.
It worked...Thanks
Back to top
Marso REXX Moderator Joined: 13 Mar 2006Posts: 1353 Location: Israel
Is there any reason why you use both formats ?
Are you aware that 1X generates a low-value and not a space ?
Back to top
Skolusu Senior Member Joined: 07 Dec 2007Posts: 2205 Location: San Jose
Marso wrote:
Are you aware that 1X generates a low-value and not a space ?
Marso,
Where did you get that information? X denotes a space for DFSORT and Z denotes a binary zero X'00'. we would like to see where specifying X is generating a value other than space.
Back to top
Marso REXX Moderator Joined: 13 Mar 2006Posts: 1353 Location: Israel
Sorry,
I received LV a few times in some output files, and I always thought it was because I used X instead of C.
Apparently there was another reason (and of course I wasn't able to recreate the case).
Back to top
Skolusu Senior Member Joined: 07 Dec 2007Posts: 2205 Location: San Jose
Marso wrote:
Sorry,
I received LV a few times in some output files, and I always thought it was because I used X instead of C.
Apparently there was another reason (and of course I wasn't able to recreate the case).
Marso,
You might have got a low-value (binary zeroes) when the SORTOUT LRECL is greater than SORTIN LRECL. Read this about padding and truncation
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1ca60/1.8.3.2
Back to top
Please enable JavaScript!