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

DFSORT -- OUTREC FIELDS


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rakesh1155

New User


Joined: 21 Jan 2009
Posts: 84
Location: India

PostPosted: Tue Feb 17, 2009 7:21 pm
Reply with quote

Hi,
I have an input file of LRECL=120 (20 key + 50 data1 + 50 data2) and two output files

(1st output file of LRECL=80 (20 byte key + 10 byte ZEROS + 50 data1) and
2nd output file of LRECL=80 (20 byte key + 10 byte ZEROS + 50 data2).

Can someone help me with the SORT commands for the same???

I know its possible using OUTREC FIELDS and OUTFIL. But, i am not able to come up with the right syntax.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Feb 17, 2009 7:28 pm
Reply with quote

Have you looked at the OUTFIL Control Statements?
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Tue Feb 17, 2009 7:30 pm
Reply with quote

try something liek this.. let us know if this helps

Code:

//STEP2 EXEC PGM=SORT                                           
//SYSPRINT DD SYSOUT=*                                         
//SYSOUT DD SYSOUT=*                                           
//SORTIN DD DSN=indsn,DISP=SHR 
//O1  DD DSN=odsn1,       
// DISP=(NEW,KEEP,KEEP),                               
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)                 
//O2  DD DSN=odsn2,       
// DISP=(NEW,KEEP,KEEP),                               
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)                 
//SYSIN DD *                                           
  SORT FIELDS=COPY                                     
   OUTFIL FNAMES=O1,                                   
          BUILD=(1,20,                                   
                 C'0000000000',               
                 21,50)
   OUTFIL FNAMES=O2,                                   
          BUILD=(1,20,                                   
                 C'0000000000',               
                 71,50)
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: Tue Feb 17, 2009 11:06 pm
Reply with quote

rakesh1155,

Here's a DFSORT job that will do what you asked for. Note the use of 10C'0'. You don't need to specify DCB attributes for the output data sets - DFSORT will set them automatically.

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//OUT1 DD DSN=...  output file1 (FB/80)
//OUT2 DD DSN=...  output file2 (FB/80)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=OUT1,BUILD=(1,20,10C'0',21,50)
  OUTFIL FNAMES=OUT2,BUILD=(1,20,10C'0',71,50)
/*
Back to top
View user's profile Send private message
rakesh1155

New User


Joined: 21 Jan 2009
Posts: 84
Location: India

PostPosted: Wed Feb 18, 2009 4:21 pm
Reply with quote

Thanks genesis786 & Frank.

It worked perfectly as it was needed.
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