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
 
Sort only detail records excluding header record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort only detail records excluding header record
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: 1187
Location: Bangalore,India

PostPosted: Thu Feb 15, 2007 11:37 am    Post subject:
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    Post subject: Re: Sort excluding Header
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    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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm

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