Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SORT file containing header records

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

New User


Joined: 20 Dec 2006
Posts: 55
Location: noida

PostPosted: Thu Apr 03, 2014 5:03 am    Post subject: SORT file containing header records
Reply with quote

Hi,

I have an input file

Code:
     FILE1       
RECORDS NUMBER      
1111        ABC   
1110        LMN   
1121        PQR
1123        XYZ


My requirement is to sort this file on the basis of 1st four bytes after skipping the first 2 header records. After sort, the output file should look like -

The header records should also be written to the output file.

Code:
     FILE1       
RECORDS NUMBER      
1110        LMN   
1111        ABC   
1121        PQR
1123        XYZ


Please help.

Thanks.
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu Apr 03, 2014 12:05 pm    Post subject:
Reply with quote

Try DATASORT

Code:
//STEP0100  EXEC  PGM=ICETOOL
//TOOLMSG   DD SYSOUT=*
//DFSMSG    DD SYSOUT=*
//IN        DD *
     FILE1
RECORDS NUMBER
1111        ABC
1110        LMN
1121        PQR
1123        XYZ
//OUT      DD  SYSOUT=*
//TOOLIN    DD *
  DATASORT FROM(IN) TO(OUT) HEADER(2) USING(CTL1)
//CTL1CNTL  DD *
  SORT FIELDS=(1,4,CH,A)
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1625
Location: NY,USA

PostPosted: Fri Apr 04, 2014 6:42 am    Post subject:
Reply with quote

Hello,

As Pandora suggested the DATASORT , you can find more on such tricks by just clicking to the below link.

ftp://ftp.software.ibm.com/storage/dfsort/mvs/sorttrck.pdf

For your question please see chapter "Sort detail records between headers and trailers" in detail with examples and explaination as to how this works.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us