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

How to SORT when records are spanned on next line.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top