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 from 8th record leaving first 7 records

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

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Thu Mar 20, 2008 8:40 pm    Post subject: Sort from 8th record leaving first 7 records
Reply with quote

Hi,
I have a file, the first 7 lines of which is a header.
I want to sort the details that are available from 8th record, leaving the first 7 as it its.

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

Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 205
Location: Bangalore

PostPosted: Thu Mar 20, 2008 9:10 pm    Post subject: Reply to: Sort from 8th record leaving first 7 records
Reply with quote

Hi,


Is there any way to identify the header record so as to distinguish it from trailer record?

Thanks,
Ajay
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 205
Location: Bangalore

PostPosted: Thu Mar 20, 2008 9:13 pm    Post subject:
Reply with quote

Is there any way to identify the header record so as to distinguish it from
Quote:
trailer
record? Sorry, I meant detail records.

-Ajay
Back to top
View user's profile Send private message
lanand_hps

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Thu Mar 20, 2008 9:17 pm    Post subject:
Reply with quote

Yes.
But is it not possible to do it just by knowing the number of rows for a header? First 7 lines are always the header.

(First 4 lines contains date, company name, etc..)
Column name -(6th line)-
----------------- -(7th line) for formatting
Details to be sorted from 8th line.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Mar 20, 2008 10:24 pm    Post subject:
Reply with quote

lanand_hps,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICEMAN                             
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                         
HEADER1                                                 
HEADER2                                                 
HEADER3                                                 
HEADER4                                                 
HEADER5                                                 
HEADER6                                                 
HEADER7                                                 
C                                                       
A                                                       
D                                                       
V                                                       
Z                                                       
U                                                       
Q                                                       
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                         
  OPTION EQUALS                                         
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,9,ZD)),   
        IFTHEN=(WHEN=(81,9,ZD,GT,7),OVERLAY=(81:9C'9'))
                                                       
  SORT FIELDS=(81,09,CH,A,                             
               01,01,CH,A)                             
                                                       
  OUTREC BUILD=(01,80)                                 
                                                       
//*                                                     
Back to top
View user's profile Send private message
lanand_hps

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Thu Mar 20, 2008 11:05 pm    Post subject:
Reply with quote

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

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Aug 06, 2008 2:13 am    Post subject:
Reply with quote

You can now do this kind of thing quite easily with the new DATASORT operator of DFSORT's ICETOOL available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). Here's an example - change the SORT statement to whatever you need:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER(7) USING(CTL1)
/*
//CTL1CNTL DD *
  SORT FIELDS=(1,1,CH,A)
/*


For complete details on the new DATASORT function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
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. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


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