Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Skip records depends on count lakshmiibmmainframes DFSORT/ICETOOL 5 Sun Dec 24, 2017 9:51 pm
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm
No new posts SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 9 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us