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
 

 

DFSORT -- OUTREC FIELDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: DFSORT -- OUTREC FIELDS
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: 2150
Location: At my coffee table

PostPosted: Tue Feb 17, 2009 7:28 pm    Post subject:
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    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Feb 17, 2009 11:06 pm    Post subject:
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    Post subject:
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    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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm


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