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 only Detail Records

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

New User


Joined: 10 Mar 2005
Posts: 41
Location: United States Of America

PostPosted: Tue Aug 30, 2011 2:12 pm    Post subject: sort only Detail Records
Reply with quote

I have a file with n number of records including header and trailer.

- Header record being first record of file
- Trailor record being last record of file

First char for Header record starts with H, and Trailor T.

Now I need to sort this file based on 13 digit Account number from column(20 to 32) (excluding header and trailor).
Back to top
View user's profile Send private message

kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Tue Aug 30, 2011 2:57 pm    Post subject:
Reply with quote

Hope this helps...

http://publib.boulder.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.iceg200/ice1cg4053.htm
Back to top
View user's profile Send private message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Tue Aug 30, 2011 4:03 pm    Post subject:
Reply with quote

Code:

//TOOLIN   DD *                                             
  DATASORT FROM(SORTIN) TO(OUT) HEADER TRAILER USING(CTL1) 
//CTL1CNTL  DD *                                           
  SORT FIELDS=(20,13,CH,A)                                   
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 30, 2011 4:13 pm    Post subject:
Reply with quote

sameer
If DATASORT does work at your shop.. You can use below..
Assuming record length 80
Code:

//STEP0100 EXEC PGM=SORT                                 
//SORTIN   DD *                                           
H                                                         
370000000030                                             
370000000004                                             
370000000050                                             
370000000001                                             
370000000020                                             
T                                                         
//SORTOUT  DD SYSOUT=*                                   
//SYSOUT   DD SYSOUT=*                                   
//SYSIN    DD *                                           
  SORT FIELDS=(81,1,CH,A,20,13,CH,A)                       
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'2')),             
        IFTHEN=(WHEN=(1,1,CH,EQ,C'H'),OVERLAY=(81:C'1')),
        IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),OVERLAY=(81:C'3')) 
  OUTFIL 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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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