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

Can this be done in DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts DFSORT - VB file RDW getting overridden DFSORT/ICETOOL 3
Search our Forums:

Back to Top