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
 

 

How to SORT when records are spanned on next line.

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

New User


Joined: 27 Jul 2007
Posts: 33
Location: mumbai

PostPosted: Thu Apr 28, 2011 11:44 pm    Post subject: How to SORT when records are spanned on next line.
Reply with quote

Hi,

Could you please help me in achieving the below output?
The input records are as given in the below structure. The input is continued into the next line, the last field starts at position 25 and continues onto the next line again at 25, and i want to sort the input based on the first field i.e. 001,002 etc. The expected output is as shwn below.

Can this functionality be implemented using ICETOOL.

Code:

Input:

1----5----10----15----20----25----30
004  PETER      AMERICA     LOVES
                            LIFE
003  SAM        UK          LOVES
                            LIFE
001  RONALD     AUSTRALIA   HATES
                            LIFE
002  KATE       AFRICA      HATES
                            LIFE
005  WILLIAM    IRELAND     HATES
                            LIFE

Output:

1----5----10----15----20----25----30
001  RONALD     AUSTRALIA   HATES
                            LIFE
002  KATE       AFRICA      HATES
                            LIFE
003  SAM        UK          LOVES
                            LIFE
004  PETER      AMERICA     LOVES
                            LIFE
005  WILLIAM    IRELAND     HATES
                            LIFE


 
Back to top
View user's profile Send private message

Skolusu

Senior Member


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

PostPosted: Fri Apr 29, 2011 12:00 am    Post subject: Reply to: How to SORT when records are spanned on next line.
Reply with quote

vaibhavjadhav,

Assuming your input is FB, LRECL=30 and the continuation line has a space in the first byte, the following DFSORT JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT           
//SYSOUT   DD SYSOUT=*             
//SORTIN   DD DSN=Your input FB 30 byte file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                 
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,NE,C' '),PUSH=(31:1,3))
  SORT FIELDS=(31,03,CH,A),EQUALS                               
  OUTREC BUILD=(1,30)                                           
//*
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 Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am


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