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

How to reformat the OUTPUT of JOINKEYS operation.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Dec 12, 2008 3:28 pm
Reply with quote

Hi,

I am running below given job and got the expected results.

Code:

//SORT01   EXEC PGM=SORT                 
//SORTOUT  DD  SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SORTJNF1 DD  DSN=INPUT.FILE.ONE,       
//             DISP=(SHR,KEEP,KEEP)                       
//SORTJNF2 DD  DSN=INPUT.FILE.TWO, 
//             DISP=(SHR,KEEP,KEEP)                       
//SYSIN    DD  *                                           
  JOINKEYS FILE=F1,FIELDS=(6,6,A)   
  JOINKEYS FILE=F2,FIELDS=(5,6,A)   
  REFORMAT FIELDS=(F2:5,6,13,10,23,5)
  SORT FIELDS=COPY                   
  END                               
/*                                   
//*


I would like to know how to how to get the output in the below format:

Code:

XXXXXX,TWO BLANKS,XXXXXXXXXX,TWO BLANKS,XXXXX


I tried using OUTFIL & OUTREC but job failed with "OUTREC BEYOND LRECL".

Please suggest.

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

New User


Joined: 24 Nov 2008
Posts: 17
Location: USA

PostPosted: Fri Dec 12, 2008 4:13 pm
Reply with quote

Hi,

Try this,

OUTFIL FILES=OUT,
OUTREC=(1:1,6,8:X,9:7,10,20:X,21:17,5)

Note:

REFORMAT FIELDS=(F2:5,6,13,10,23,5) for this reformat

LREC should be 25(SORTOUT file length)
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Dec 12, 2008 4:13 pm
Reply with quote

Ramsri,

You need to mention the positions in OUTREC/INREC based on the REFORMAT record and NOT the original file. Here your reformatted LRECL is just 21 and mentioning file positions beyond that would result in error.
You should be using a Sort card like this.
Code:
//SYSIN    DD  *                                           
  JOINKEYS FILE=F1,FIELDS=(6,6,A)   
  JOINKEYS FILE=F2,FIELDS=(5,6,A)   
  REFORMAT FIELDS=(F2:5,6,13,10,23,5)
  INREC FIELDS=(1,6,C',',2X,7,10,C',',2X,17,5)
  SORT FIELDS=COPY                   
  END                               
/* 
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Dec 12, 2008 5:29 pm
Reply with quote

Wow......wonderful..... icon_biggrin.gif

Arun, I have made a note of what you suggested. That is very good tip to remember. icon_smile.gif Thank you very much.

Bye.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
Search our Forums:

Back to Top