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 detail between headers and trailers?

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

New User


Joined: 25 Sep 2007
Posts: 7
Location: pune

PostPosted: Tue Jul 13, 2010 11:45 pm    Post subject: How to sort detail between headers and trailers?
Reply with quote

I have i/p file like below :

H1 ---> Header record
I1
I5
I9
I3
T1 ----> Trailer record
H2 ---- > Header record
I12
I40
I23
T2 -----> Trialer record

and I want o/p as below ;
H1
I1
I3
I5
I9
T1
H2
I12
I23
I40
T2

i.e. all details records should be sorted and header and trailer records should not be sorted.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Jul 14, 2010 1:00 am    Post subject:
Reply with quote

You can use a DFSORT job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
H1
I1
I5
I9
I3
T1
H2
I12
I40
I23
T2
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'H'),PUSH=(81:ID=8)),
        IFTHEN=(WHEN=INIT,OVERLAY=(89:C'1')),
        IFTHEN=(WHEN=(1,1,CH,EQ,C'H'),OVERLAY=(89:C'0')),
        IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),OVERLAY=(89:C'9'))
  SORT FIELDS=(81,8,ZD,A,89,1,CH,A,1,3,CH,A)
  OUTREC BUILD=(1,80)
/*
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
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
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

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