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
 
Sorting without Header - DFSORT tips

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

New User


Joined: 12 Mar 2008
Posts: 53
Location: Chennai

PostPosted: Tue Oct 27, 2009 11:24 pm    Post subject: Sorting without Header - DFSORT tips
Reply with quote

Hi,

I want to sort a 'N' number of records without affecting the header part of the file.
For Example, I have a fille with header and data portion.
XXXXXXX - Header part
ZZZZZZZ - Data Part
TTTTTTTT - Data Part
DDDDDD - Data Part
BBBBBBB - Data Part
AAAAAAA - Data Part

After sorting, my header part should remain the same. It should not be touched (I mean it should not be sorted along with the data portion). Only the Data portion alone be sorted.
My Output should be,
XXXXXXX
AAAAAAA
BBBBBBB
DDDDDDD
TTTTTTT
ZZZZZZZ

Please help me out with single DFSORT step.

Note:- No Icetool is used. DFSORT is the only option to be used.

Thanks,
Ashok Kumar.K
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Oct 27, 2009 11:37 pm    Post subject:
Reply with quote

ashok4u_it,

Quote:

Please help me out with single DFSORT step. Note:- No Icetool is used. DFSORT is the only option to be used.


I don't get this. ICETOOL is part of DFSORT. ICETOOL has been shipped with DFSORT since 1991!
Back to top
View user's profile Send private message
ashok4u_it

New User


Joined: 12 Mar 2008
Posts: 53
Location: Chennai

PostPosted: Tue Oct 27, 2009 11:49 pm    Post subject: Reply to: Sorting without Header - DFSORT tips
Reply with quote

Oops... Everytime, I used to get the statement as "ICETOOL IS A PART OF DFSORT"... Yup, I know it is a part of DFSORT. But, i do have some restrictions in using ICETOOL statements in my work place. Please believe and understand me. But, no reasons yet from my admin.

Thanks
Ashok Kumar.K
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Oct 28, 2009 12:37 am    Post subject:
Reply with quote

ashok4u_it,

The following DFSORT JCL will give you the desired results. I assumed that your input is FB recfm and 80 bye LRECL and your key to be sorted is first 9 bytes.

Code:

//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                           
XXXXXXX  - HEADER PART                                   
ZZZZZZZ  - DATA PART                                     
TTTTTTTT - DATA PART                                     
DDDDDD   - DATA PART                                     
BBBBBBB  - DATA PART                                     
AAAAAAA  - DATA PART                                     
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                           
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),     
  IFTHEN=(WHEN=(81,8,ZD,GT,1),OVERLAY=(81:C'2'))         
  SORT FIELDS=(81,1,CH,A,1,9,CH,A),EQUALS                 
  OUTREC BUILD=(1,80)                                     
/*


The output of this is

Code:

XXXXXXX  - HEADER PART   
AAAAAAA  - DATA PART     
BBBBBBB  - DATA PART     
DDDDDD   - DATA PART     
TTTTTTTT - DATA PART     
ZZZZZZZ  - DATA PART     
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1521
Location: Chennai

PostPosted: Wed Oct 28, 2009 1:02 am    Post subject:
Reply with quote

Thats,

Really cool icon_smile.gif
Back to top
View user's profile Send private message
ashok4u_it

New User


Joined: 12 Mar 2008
Posts: 53
Location: Chennai

PostPosted: Tue Nov 03, 2009 11:27 pm    Post subject: Reply to: Sorting without Header - DFSORT tips
Reply with quote

Thanks a lot Skolusu. It works fine. Thanks for ur help.

Regards
Ashok K.
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 Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts Sorting on text - but in non-alphabet... Roy Ware SYNCSORT 5 Wed Aug 23, 2017 9:15 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am

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