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

Sort only detail records excluding header record


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

New User


Joined: 19 Sep 2005
Posts: 9

PostPosted: Thu Feb 15, 2007 11:23 am
Reply with quote

The requirement is -
The input file has one header. I need to sort only detail records excluding header record. I have tried SKIPREC which is discarding header record altogether. But I need that header record to appear in the output. Is there any other way?
Thanks in advance

Thanks and Regards,
Debasish.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Feb 15, 2007 11:37 am
Reply with quote

Hi There,

U can use following DFSORT statements:

Code:
//SYSIN DD *
** Put special key of '1' in 81 for data records.
     INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'1')),
** For header record, put special key of '0' in 81.
               IFTHEN=(WHEN=(1,4,CH,EQ,C'HEDR'),
                  OVERLAY=(81:C'0')),
** Sort by special key ('0', '1') and then regular key.
    SORT FIELDS=(81,1,CH,A,14,10,CH,A)
** Remove special key.
    OUTREC BUILD=(1,80)
/*


Here I assume that ur header record contain HEDR at first 4 bytes & key is at 14 the position & offset is of 10 bytes
Back to top
View user's profile Send private message
chanda.debasish

New User


Joined: 19 Sep 2005
Posts: 9

PostPosted: Fri Feb 16, 2007 7:42 pm
Reply with quote

Thank you so much. It has worked perfectly.
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 SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top