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
 

 

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: 2276
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 find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Joinkeys with condition scdinesh DFSORT/ICETOOL 10 Tue Feb 14, 2017 12:20 am


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