Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Help with Sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Keanehelp

New User


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

PostPosted: Wed Apr 04, 2012 8:24 pm    Post subject: Help with Sort
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    Post subject:
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: 70
Location: USA, CA.

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

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

REXX Moderator


Joined: 13 Mar 2006
Posts: 1228
Location: Israel

PostPosted: Thu Apr 05, 2012 8:05 pm    Post subject:
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    Post subject:
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: 1228
Location: Israel

PostPosted: Wed Apr 11, 2012 3:22 pm    Post subject:
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    Post subject:
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

http://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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us