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
 
How to reformat the OUTPUT of JOINKEYS operation.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to reformat the OUTPUT of JOINKEYS operation.
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    Post subject:
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: 2285
Location: @my desk

PostPosted: Fri Dec 12, 2008 4:13 pm    Post subject:
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    Post subject: Reply to: How to reformat the OUTPUT of JOINKEYS operation.
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts it is possible output a SET value fro... Martylin JCL & VSAM 5 Fri Sep 22, 2017 7:08 am

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