Page 1 of 1

Question related to TMS tape dataset and vol serial

PostPosted: Fri Mar 24, 2017 12:56 pm
by Revathi
Hi,

I'm looking for a solution how to read vol serial number of a TMS dataset (which is dynamic) and pass that value in a JCL,

For eg:

//COPY EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=(,)
//IN DD DSN=inputfile,
// DISP=SHR,
// UNIT=CTAPE,VOL=SER=VOLSER
//OUT DD DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// DCB=(LRECL=10,BLKSIZE=0,RECFM=FB),
// DSN=outputfile
//SYSIN DD *

Currently i'm manually passing the vol ser number but i need this to be done automatically.

Kindly help me on this.

Re: Question related to TMS tape dataset and vol serial

PostPosted: Fri Mar 24, 2017 2:56 pm
by NicC
Is your input dataset not catalogued? If not, why not?

And why use IDCAMS to do a copy? Why not one of the copy utilities - IEBGENER/ICEGENER?

Re: Question related to TMS tape dataset and vol serial

PostPosted: Fri Mar 24, 2017 4:24 pm
by steve-myers
Just exactly what do you mean by a "TMS data set"? "TMS" usually refers to the CA1 tape management system, but I fear you mean something else. Next, what do you mean by "which is dynamic"? You must answer both questions before anyone can help you.

NicC asked about the catalog status of the input data set, which prompts two more questions.
  1. Do you know the data set name before you prepare this job? The way you have worded the question seems to me to imply you are getting it from somewhere. Where?
  2. Does the data from which you are deriving the data set name also include the volume serials?
All in all, we now have four questions for you to answer. These answers may raise additional questions for you to answer.

NicC criticized the use of IDCAMS to perform the copy. Now IDCAMS can be a simple method to execute several copy operations in a single z/OS job step, but it has never been regarded as a very efficient data mover.

Re: Question related to TMS tape dataset and vol serial

PostPosted: Fri Mar 24, 2017 4:26 pm
by Robert Sample
You MUST use two jobs to do this -- because once the job goes through the converter / interpreter, the JCL CANNOT be changed and hence putting the volume serial in the executing JCL is simply not possible. You may need to write a program in the language of your choice to use the TMS API to retrieve the volume serial and then submit a job through the internal reader using that volume serial.

Re: Question related to TMS tape dataset and vol serial

PostPosted: Sat Mar 25, 2017 2:18 pm
by willy jensen
Or one job running a program doing dynamic allocation. REXX springs to mind.

Re: Question related to TMS tape dataset and vol serial

PostPosted: Mon Mar 27, 2017 3:40 pm
by Robert Sample
pass that value in a JCL
If the OP is using JCL and not dynamic allocation, two jobs are required.