MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Backing up the seq dataset

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Thu Sep 13, 2007 8:09 am    Post subject: Backing up the seq dataset Reply with quote

Hi All,

Here's a weird requirement . Let me know If this can be achieved using SORT.

I have a JCL which calls a PROC(PROC1). The JCL passes FILE NAME to the PROC ( Note the File name cannot be hardcoded here). I need to copy the contents of FILE into a backup GDG in the PROC. Here's an example.

FILE NAME = XYZ.ABC.T5998

In the PROC I need to get the file name and copy the contents of the file into XYZ.ABC.BCKUP(+1). Can this be done using SORT or any other utilities ?


The issue here is that FILE NAME gets passed from JCL and is not constant always.

Please Help !!

Thanks,
- Mt
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Sep 13, 2007 8:17 am    Post subject: Reply with quote

Quote:

The JCL passes FILE NAME to the PROC

Martin,

If the JCL passes the filename as a symbolic to the proc then what is the problem? code the symbolic for both input and output file name and you are all set

EX:
Code:

//BKUPPROC PROC FILENAME=' '
//*
//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=&FILENAME,
//            DISP=SHR
//SORTOUT  DD DSN=&FILENAME..BKCP(+1),                 
//            DISP=(NEW,CATLG,DELETE),                   
//            UNIT=PROD,                                 
//            SPACE=(CYL,(X,Y),RLSE)
/*                     
//SYSIN    DD DSN=SORTPARM.PDS(SORTCOPY),
//            DISP=SHR


the JCL will pass the filename

Code:

//STEP0100 EXEC BKUPPROC,FILENAME='XXX.YYY.ZZZ'


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Thu Sep 13, 2007 8:54 am    Post subject: Reply with quote

kolusu,

I have a small doubt.

As per your solution, for example
filename is 'XYZ.ABC.T5998'

Then the backup will go to 'XYZ.ABC.T5998.BKCP(+1)'
I feel Martin requires the backup to be in 'XYZ.ABC.BKCP(+1)' rt?

I would suggest passing 2 parameters., 1st parameter to represent the filename without the last qualifier and the 2nd parameter to represent the last qualifier.

In the proc, GDG should be specified as &FILEPARM1..BKCP(+1)

Please let me know if I am missing something.

Vivek G
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Sep 13, 2007 9:21 am    Post subject: Reply with quote

vivek1983,

Op needs to clarify if he wants a single backup file or different backup files. If he needs a single back up file then he simply can hardcode the output file name instead of passing a symbolic

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Thu Sep 13, 2007 9:43 am    Post subject: Reply with quote

Or multple symbolics.......
Back to top
View user's profile Send private message
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Thu Sep 13, 2007 1:00 pm    Post subject: Reply with quote

Hi All,

Thanks for your prompt replies, The problem as I mentioned is :

- The file Name gets passed as symbolic and this cannot be changed.
- The file Name can sometimes be a GDG file ( ex: XYZ.DEF.G0001V00 ) and in this case Kolusu's solution might not work.

Vivek ,

You are right , I need to remove the last qualifier and unfortunatly the file name cannot be broken up into 2 parms.

Is there a way out?

- Mt
Back to top
View user's profile Send private message
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Thu Sep 13, 2007 1:03 pm    Post subject: Reply with quote

Just to add...

The backup file name must be first 2 qualifiers of the file name .bckup.

Ex : If the file name is ABC.XYZ.T5998
Backup file name must be ABC.XYZ.BCKUP(+1)

Ex : If the file name is ABC.DEF.XYZ.G001V00
Backup file name must be ABC.DEF.BCKUP(+1)
Back to top
View user's profile Send private message
jsharon1248
Intermediate


Joined: 08 Aug 2007
Posts: 291
Topics: 2
Location: Chicago

PostPosted: Thu Sep 13, 2007 1:17 pm    Post subject: Reply with quote

I can't think of any way to manipulate text using JCL. Found this in the z/OS JCL Reference in the System Symbols and JCL Symbols section:

JCL does not support substringing of system symbols or JCL symbols.

The only thing I can think of would be to pass the symbolic as a parm to a program that would parse the value and dynamically allocate the files. Shouldn't be too hard with REXX.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group