IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sort from 8th record leaving first 7 records


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 206
Location: Bangalore

PostPosted: Thu Mar 20, 2008 9:10 pm
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: 206
Location: Bangalore

PostPosted: Thu Mar 20, 2008 9:13 pm
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
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
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
Reply with quote

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

DFSORT Developer


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

PostPosted: Wed Aug 06, 2008 2:13 am
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:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top