Page 1 of 3

Replacing PS name with new name

PostPosted: Mon Feb 13, 2012 7:59 pm
by vamsyk9
Hi,

I am trying sort using joins to do the below scenario, but it is not giving of what i am expecting
File1

//GO.A DD DSN=NAME1.ORIGNAL,DISP=OLD
//GO.B DD DSN=XXX.NAME.G0403V00,DISP=SHR, \* need to change to new GDG
// DCB=BUFNO=32,UNIT=3490,
// XXX.NAME \*need to change with vol
//So on .. similar steps for all the files
File2
DISP=SHR,DSN=XXX.NAME.G0404V00 VOL=SER=(666666)
DISP=SHR,DSN=XXX.NAME1.G0407V00 VOL=SER=(666667,666665)
DISP=SHR,DSN=XXX.NAME2.G0403V00 VOL=SER=(666662)
DISP=SHR,DSN=XXX.NAME3.G0402V00 VOL=SER=(666661)

Output File should contain

//GO.A DD DSN=NAME1.ORIGNAL,DISP=OLD \* No change
//GO.B DD DSN=XXX.NAME.G0404V00,DISP=SHR, \*New file to be replaced
// DCB=BUFNO=32,UNIT=3490, \* no change
// VOL=SER=(666666) \*Need to replace the file name with vol as mentioned*
Any idea, which one can be better to do it.

Re: Replacing PS name with new name

PostPosted: Mon Feb 13, 2012 8:01 pm
by NicC
You stil have not posted the code that you have tried or what your wrong output was.

Re: Replacing PS name with new name

PostPosted: Mon Feb 13, 2012 8:07 pm
by vamsyk9
OPTION COPY
JOINKEYS FILE=F1,FIELDS=(21,24) \*File1 name comparision
JOINKEYS FILE=F2,FIELDS=(14,24) \*File 2 name comparison
REFORMAT FIELDS=(F1:1,80)
JOIN UNPAIRED,F1,ONLY

Getting only one line output as below
\\GO.A DD DSN=NAME1.ORIGNAL,DISP=OLD
\\ only first steps of the file1 are displaying .Can you please help

Re: Replacing PS name with new name

PostPosted: Mon Feb 13, 2012 8:18 pm
by BillyBoyo
I think you are a little way off in trying to use Joinkeys like that for this. Joinkeys will process two files, with keys of the same length. The keys can be in different positions on the two files, but must be in the same position within each file. I don't think you have that with your data

If you can describe exactly what you are trying to do, with complete (ie covering all possibilities) input data and expected output, I'm sure you'll be able to get some good advice.

Re: Replacing PS name with new name

PostPosted: Mon Feb 13, 2012 8:26 pm
by vamsyk9
Files are having the key value as mentioned below.

"The keys can be in different positions on the two files, but must be in the same position within each file"

I am creating a job which will automatically pick the latest generation from file2 and override file1 with new generation giving to output file as mentioned above..

Re: Replacing PS name with new name

PostPosted: Mon Feb 13, 2012 9:37 pm
by vamsyk9
Can somebody help on the above pls..

Re: Replacing PS name with new name

PostPosted: Tue Feb 14, 2012 12:53 am
by NicC
As previoously mentioned elsewhere - why not just use generation (0) and do away with this file matching and trying to update?

Re: Replacing PS name with new name

PostPosted: Tue Feb 14, 2012 1:02 am
by enrico-sorichetti
please reply to the question asked here
jcl/topic7148.html#p32037

Re: Replacing PS name with new name

PostPosted: Tue Feb 14, 2012 2:45 am
by Frank Yaeger
Can somebody help on the above pls..


I doubt it because you haven't clearly explained what you're trying to do, the "rules" for doing it, or the variations you have to deal with. We can't read your mind.

If you would take the time and effort to clearly explain everything, with examples of input and expected output for all the cases to be handled, then we might be able to help.

Re: Replacing PS name with new name

PostPosted: Tue Feb 14, 2012 3:17 am
by enrico-sorichetti
Hallo Frank!
my understanding is that the TS is trying to keep up to date some jcl which uses absolute GDG names
but apart the technical DFSORT problem of updating the JCL
looks like in the TS organization there is a poor understanding of how GDG should be used
note also the horrible use of VOL=SER clause for a GDG, brrrr... ;)