IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Help with Sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Keanehelp

New User


Joined: 27 May 2008
Posts: 71
Location: USA, CA.

PostPosted: Wed Apr 04, 2012 8:24 pm
Reply with quote

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
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Wed Apr 04, 2012 8:44 pm
Reply with quote

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
View user's profile Send private message
Keanehelp

New User


Joined: 27 May 2008
Posts: 71
Location: USA, CA.

PostPosted: Thu Apr 05, 2012 7:33 pm
Reply with quote

It worked...Thanks
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Apr 05, 2012 8:05 pm
Reply with quote

Code:
1X,'|',1X

Code:
C' | '

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Apr 05, 2012 10:21 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Apr 11, 2012 3:22 pm
Reply with quote

Sorry, icon_redface.gif

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Apr 11, 2012 11:30 pm
Reply with quote

Marso wrote:
Sorry, icon_redface.gif

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top