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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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