View previous topic :: View next topic
|
Author |
Message |
saikat
New User
Joined: 23 Jun 2008 Posts: 26 Location: pune
|
|
|
|
Hi,
I want to copy a PS file to another in JCL step.
But the second file where I want to copy file should have same filename as first filename except the first level qualifier to be different.
The first filename is not static , it gets changed with date and timestamp for each job submission.
So I want to strip off all qualifiers from first filename except first level qualifier and generate the second filename based on this with new hlq.
Please advise how to achieve this. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Show how you do the first file name. Then explain why the second can't be done that way. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
You achieve this in the standard way that has been described many, many, many times -- and after more than 4 years on this forum surely you have read that a few times.
Write a program in the language of your choice to create the JCL with the correct file names. Copy that JCL to the internal reader, either in your program or via a utility. |
|
Back to top |
|
|
saikat
New User
Joined: 23 Jun 2008 Posts: 26 Location: pune
|
|
|
|
Is it possible to do via REXX?? |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
saikat wrote: |
Is it possible to do via REXX?? |
Robert Sample wrote: |
Write a program in the language of your choice to create the JCL with the correct file names. Copy that JCL to the internal reader, either in your program or via a utility. |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Have you considered putting this job in a cataloged PROCedure and using symbolic parameter(s)? |
|
Back to top |
|
|
Juan Ramirez de Arellano
New User
Joined: 03 Oct 2012 Posts: 3 Location: Mexico
|
|
|
|
saikat wrote: |
Is it possible to do via REXX?? |
Hi! Yes, it is. I have done something similar via REXX years ago. Sadly after this years I haven't coded any REXX program again so I cannot be more helpful.
Good luck! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
It is best to reply when you have a contribution to the topic.
Telling the poster you did something like this "once upon a time" but no longer have the code and do not remember exactly how is not very helpful. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
However, it was a Yes/No question! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Nic,
Robert had posted and Akatsukami repeated:
Quote: |
Write a program in the language of your choice to create the JCL with the correct file names. |
And as REXX is a language that many choose, this would be 2 "yes, it can's". . . |
|
Back to top |
|
|
ezio vin
New User
Joined: 16 Aug 2012 Posts: 44 Location: india
|
|
|
|
hi,
i cant able to understand what you need exactly but here is the REXX code to change the first qualifier alone
Code: |
ADDRESS ISREDIT
"(JCLLINE) = LINE .ZCSR"
JCLLINE=STRIP(JCLLINE)
PARSE VAR JCLLINE DUMM 'DSN=' INDSN ',' BRR JUNK
SAY 'INPUT FILE:' INDSN
PARSE VAR INDSN VARA '.' OUTDSN',' BRR JUNK
SAY 'OUTPUT FILE:' XXX.OUTDSN |
Output
Code: |
INPUT FILE: AAA.ABCD.AABBCCDD.S122.M11111
OUTPUT FILE: XXX.ABCD.AABBCCDD.S122.M11111
*** |
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
saikat wrote: |
The first filename is not static , it gets changed with date and timestamp for each job submission.
So I want to strip off all qualifiers from first filename except first level qualifier and generate the second filename based on this with new hlq. |
Using some utility-program with the capability of copy-opration and keeping the HLQs of input and output static should do what you say, no?
I'm late to the party and possibly I misunderstood. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Saikat..... You just asked question(which makes no sense) and got lost.... |
|
Back to top |
|
|
|