IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Want to copy a PS file to another in JCL step


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
saikat

New User


Joined: 23 Jun 2008
Posts: 26
Location: pune

PostPosted: Thu Sep 27, 2012 4:17 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Sep 27, 2012 4:20 pm
Reply with quote

Show how you do the first file name. Then explain why the second can't be done that way.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Sep 27, 2012 4:38 pm
Reply with quote

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
View user's profile Send private message
saikat

New User


Joined: 23 Jun 2008
Posts: 26
Location: pune

PostPosted: Thu Sep 27, 2012 5:34 pm
Reply with quote

Is it possible to do via REXX??
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Sep 27, 2012 6:55 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Sep 27, 2012 7:05 pm
Reply with quote

Hello,

Have you considered putting this job in a cataloged PROCedure and using symbolic parameter(s)?
Back to top
View user's profile Send private message
Juan Ramirez de Arellano

New User


Joined: 03 Oct 2012
Posts: 3
Location: Mexico

PostPosted: Mon Oct 08, 2012 4:04 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Oct 09, 2012 7:56 am
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Oct 09, 2012 12:18 pm
Reply with quote

However, it was a Yes/No question!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Oct 09, 2012 7:00 pm
Reply with quote

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
View user's profile Send private message
ezio vin

New User


Joined: 16 Aug 2012
Posts: 44
Location: india

PostPosted: Wed Oct 10, 2012 3:55 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Oct 18, 2012 12:12 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Oct 18, 2012 4:01 pm
Reply with quote

Saikat..... You just asked question(which makes no sense) and got lost.... icon_eek.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top