View previous topic :: View next topic
|
Author |
Message |
pkmurali Warnings : 1 Active User
Joined: 15 Dec 2005 Posts: 271
|
|
|
|
Hi all,
I am trying to copy the matching record from two files ( VB files) as shown below
Code: |
//STEP01 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=VARIABLE.FILE1,DISP=SHR
//SORTJNF2 DD DSN=VARIABLE.FILE2,DISP=SHR
//SORTOUT DD DSN=VARIABLE.FILE3,DISP=SHR
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS(20,7,A)
JOINKEYS FILE=F2,FIELDS(5,7,A)
REFORMAT FIELDS=(F2:1,4,1504)
OPTION COPY
/*
|
But i am getting matching records but the output file is having spaces, instead of having data. Please let me know if i am missing any syntax. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
That is incomplete.
You need to show us what do you have at this offsets.. F2:1,4,1504)
Also you need to show us sample data. and I hope the files are sorted before you do a join. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Rohit, It's not incomplete, it's rare example of a variable-length REFORMAT record definition.
Whether intended is a different question :-)
pkmurali, what do you have from position 1504 to the end of the record on File 2? Because that's what you've asked to be placed on the REFORMAT record, nothing else except the RDW. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Bill, I meant that when TS say about getting spaces without showing the sample record then it is difficult to judge what was wrong as at that offset there could already be a spaces in the input file who knows....
Otherwise, I agree with you that this is a rare example of VB REFORMAT. |
|
Back to top |
|
|
|