View previous topic :: View next topic |
Author |
Message |
Martin Beginner

Joined: 20 Mar 2006 Posts: 133 Topics: 58
|
Posted: Thu Sep 13, 2007 8:09 am Post subject: Backing up the seq dataset |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Sep 13, 2007 8:17 am Post subject: |
|
|
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 |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Thu Sep 13, 2007 8:54 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Sep 13, 2007 9:21 am Post subject: |
|
|
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 |
|
 |
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Thu Sep 13, 2007 9:43 am Post subject: |
|
|
Or multple symbolics....... |
|
Back to top |
|
 |
Martin Beginner

Joined: 20 Mar 2006 Posts: 133 Topics: 58
|
Posted: Thu Sep 13, 2007 1:00 pm Post subject: |
|
|
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 |
|
 |
Martin Beginner

Joined: 20 Mar 2006 Posts: 133 Topics: 58
|
Posted: Thu Sep 13, 2007 1:03 pm Post subject: |
|
|
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 |
|
 |
jsharon1248 Intermediate
Joined: 08 Aug 2007 Posts: 291 Topics: 2 Location: Chicago
|
Posted: Thu Sep 13, 2007 1:17 pm Post subject: |
|
|
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 |
|
 |
|
|