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
 
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 query to fetch record which has only ... maxsubrat DB2 10 Mon Dec 11, 2017 5:03 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Squeeze record left so that zeroes ar... Vignesh Sid SYNCSORT 5 Fri Nov 10, 2017 1:40 pm

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