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
 

 

Can this be done in DFSORT

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

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Fri Mar 06, 2009 2:38 am    Post subject: Can this be done in DFSORT
Reply with quote

Hi,

I have a requirement, where I have the input file in this format
C 02111 - 02115 100

I need the output to be

C02111100
C02112100
C02113100
C02114100
C02115100

Note that what we are doing is writing the output record starting with value 02111 to 02115, along with the other two feilds ( C & 100 ).

Please consider any position of input/output fields as I will importing this from excel.

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

Skolusu

Senior Member


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

PostPosted: Fri Mar 06, 2009 3:03 am    Post subject: Reply to: Can this be done in DFSORT
Reply with quote

ap_mainframes,

Try this job

Code:

//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD *                                                   
C 02111 - 02115 100                                               
//SORTOUT  DD DSN=&&C1,SPACE=(TRK,(1,0),RLSE),DISP=(,PASS)       
//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                               
  OUTREC IFTHEN=(WHEN=INIT,                                       
  OVERLAY=(81:+1,ADD,(11,5,ZD,SUB,3,5,ZD),M11,LENGTH=5)),         
  IFTHEN=(WHEN=(81,5,ZD,GT,1),                                   
  BUILD=(2:C'BUILD=(1,1,SEQNUM,5,ZD,START=',3,5,C',17,3),REPEAT=',
         81,5,80:X)),                                             
  IFTHEN=(WHEN=NONE,                                             
  BUILD=(2:C'BUILD=(1,1,SEQNUM,5,ZD,START=',3,5,C',17,3)',80:X)) 
/*                                                               
//STEP0200 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD *                                                   
C 02111 - 02115 100                                               
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                               
  OUTFIL FNAMES=SORTOUT,                                         
//         DD DSN=&&C1,DISP=SHR                                   
/*
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 DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am
No new posts Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm


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