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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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