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
 
Want to sort the file from 3rd record to 99th record only

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

Active User


Joined: 17 Mar 2006
Posts: 171
Location: Bangalore

PostPosted: Wed Dec 17, 2008 4:48 pm    Post subject: Want to sort the file from 3rd record to 99th record only
Reply with quote

My file has 100 records.I want to sort the file from 3rd record to 99th record only.


Sample file of 8Record is as below I want to sort By BCS_STARTER_TRACKING_NO|ORDER_NO 8 records only. Output file should have header, column name and Trailer also. Can this be done in One SORT setp..? Please help.

Code:
HEADER  20080804
RESPONSE_NO|SMART_LEAD_NO|BCS_STARTER_TRACKING_NO|ORDER_NO
206882 |595110 |20182  |32440317   |
207565 |596549 |21061  |3318-3738   |
207572 |596549 |21065  |3318-5392   |
207576 |596549 |21053  |33188512   |
207566 |596549 |21067  |33188516   |
207568 |596549 |21057  |33188518   |
207581 |596549 |21054  |33188523   |
207573 |596549 |21064  |33188528   |
TRAILER 20081006 000000008
Back to top
View user's profile Send private message

nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Wed Dec 17, 2008 6:26 pm    Post subject:
Reply with quote

Try this code.

Code:
//S1 EXEC PGM=ICEMAN                                               
//TOOLMSG   DD  SYSOUT=*                                           
//DFSMSG    DD  SYSOUT=*                                           
//SYSOUT DD SYSOUT=*                                               
//SORTIN DD *                                                       
HEADER  20080804                                                   
RESPONSE_NO|SMART_LEAD_NO|BCS_STARTER_TRACKING_NO|ORDER_NO   |     
206882     |595110       |20182                  |32440317   |     
207565     |596549       |21061                  |3318-3738  |     
207572     |596549       |21065                  |3318-5392  |     
207576     |596549       |21053                  |33188512   |     
207566     |596549       |21067                  |33188516   |     
207568     |596549       |21057                  |33188518   |     
207581     |596549       |21054                  |33188523   |     
207573     |596549       |21064                  |33188528   |     
TRAILER 20081006 000000008                                         
/*                                                                 
//SORTOUT DD SYSOUT=*                                               
//SYSIN DD *                                                       
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'1')),                       
        IFTHEN=(WHEN=(1,6,CH,EQ,C'HEADER'),OVERLAY=(81:C'0')), 
        IFTHEN=(WHEN=(1,8,CH,EQ,C'RESPONSE'),OVERLAY=(81:C'0')),
        IFTHEN=(WHEN=(1,7,CH,EQ,C'TRAILER'),OVERLAY=(81:C'9')) 
  SORT FIELDS=(81,1,CH,A,22,23,CH,A,51,11,CH,A)                 
  OUTREC FIELDS=(1,80)                                         
/*


Output:
Code:
HEADER  20080804                                               
RESPONSE_NO|SMART_LEAD_NO|BCS_STARTER_TRACKING_NO|ORDER_NO   | 
206882     |595110       |20182                  |32440317   | 
207576     |596549       |21053                  |33188512   | 
207581     |596549       |21054                  |33188523   | 
207568     |596549       |21057                  |33188518   | 
207565     |596549       |21061                  |3318-3738  | 
207573     |596549       |21064                  |33188528   | 
207572     |596549       |21065                  |3318-5392  | 
207566     |596549       |21067                  |33188516   | 
TRAILER 20081006 000000008                                     
Back to top
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Wed Dec 17, 2008 6:52 pm    Post subject: Reply to: DFSORT Help
Reply with quote

Hi,

You can try using DATASORT( new dfsort funstion)

Code:
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER(2) TRAILER(1) USING(CTL1)
//CTL1CNTL DD *
  SORT FIELDS=(26,30,CH,A)


This function does not require any marker to identify header and trailer records.

You just need to mention no. of header or trailer records and it works.

Hope this helps.
Thanks,
-Kapil.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Dec 17, 2008 10:09 pm    Post subject:
Reply with quote

shrivatsa,

you can very do this type sorting between header and trailer records easily the new DATASORT function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:

Code:

//STEP0100 EXEC PGM=ICETOOL                                   
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//IN       DD *                                               
HEADER  20080804                                               
RESPONSE_NO|SMART_LEAD_NO|BCS_STARTER_TRACKING_NO|ORDER_NO   |
206882     |595110       |20182                  |32440317   |
207565     |596549       |21061                  |3318-3738  |
207572     |596549       |21065                  |3318-5392  |
207576     |596549       |21053                  |33188512   |
207566     |596549       |21067                  |33188516   |
207568     |596549       |21057                  |33188518   |
207581     |596549       |21054                  |33188523   |
207573     |596549       |21064                  |33188528   |
TRAILER 20081006 000000008                                     
//OUT      DD SYSOUT=*                                         
//TOOLIN   DD *                                               
  DATASORT FROM(IN) TO(OUT) HEADER(2) TRAILER USING(CTL1)     
//CTL1CNTL DD *                                               
  SORT FIELDS=(26,24,CH,A)                                     
/*


If you don't have the July, 2008 PTF installed, ask your System Programmer to install it (it's free).

For complete details on the new DATASORT 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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am

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