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: 2352
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 How to get the output from submit com... Joanna2016 CLIST & REXX 10 Tue Feb 06, 2018 7:26 am
No new posts Utility for search operation Gopalakrishna551 TSO/ISPF 11 Wed Jan 03, 2018 11:07 am
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm

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