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
 
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 Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Formatting using DFsort Guru Nandu DFSORT/ICETOOL 5 Thu Nov 30, 2017 7:33 am
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts OUTREC with ALter Command scorp_rahul23 DFSORT/ICETOOL 1 Wed Nov 22, 2017 3:10 pm
No new posts Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am

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