JCL to Receive multiple datasets together



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

JCL to Receive multiple datasets together

Postby Mainframe330 » Sun Aug 10, 2014 9:31 am

Hi,

One urgent help required.

I need to create a JCL which will receive multiple datasets at one go. (this will be a replace of TSO Receive command). In TSO receive for multiple datasets command need to be executed multiple times.

Can somebody help me out in creating that JCL where using Control Card I can receive multiple datasets, at one go, from another mainframe?

Control card can be used to get the names of the input datasets to be received.

Also another requirement is, the order in which the datasets xmitted, should not affect the order in which it was received. (i.e.) we should be able to receive the datasets in any order.

I have managed to write one where one dataset can be received (as shown below). But can somebody help me out in receiving multiple at one go?

I would be really obliged if somebody can help me on this regard.

//RCVJOB JOB (AYANRCV)
//*
//*
//RECV EXEC PGM=IKJEFT01,DYNAMNBR=20
//DDINP DD DISP=SHR,DSN=HLQ.INPUT.XMIT
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
RECEIVE +
INDDNAME(DDINP) +
NODISPLAY +
NONAMES
DATASET(HLQ.AYAN.TARGET)
/*
Mainframe330
 
Posts: 3
Joined: Sun Aug 10, 2014 8:49 am
Has thanked: 0 time
Been thanked: 0 time

Re: JCL to Receive multiple datasets together frm another ma

Postby steve-myers » Sun Aug 10, 2014 7:44 pm

The XMIT command will store 1, and only 1, data set in an output data set.

If you want to send multiple data sets in 1 data set, try to use the ADRDSSU DUMP command to generate a container data set containing multiple data sets, XMIT the container data set, then use RECEIVE to restore the container data set, and ADRDSSU to restore the data sets in the container data set.

In fact, follow this script!
  • Use ADRDSSU to create the container data set.
  • Use TERSE or AMATERSE to compress the ADRDSSU container data set.
  • Forget XMIT/RECEIVE, just transport the compressed container data set.
  • Use TERSE or AMATERSE to expand the compressed container data set.
  • Use ADRDSSU to extract the data sets from the container data set.
I've never tried this. I can imagine all sorts of issues trying to restore data sets that were SMS managed on the source system.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: JCL to Receive multiple datasets together frm another ma

Postby Mainframe330 » Sun Aug 10, 2014 11:05 pm

Thanks for your reply Steve.

I basically want to receive multiple PDS.

Can this be done using Control Card? Can the multiple datasets, which will be received, be mentioned in the control card?
Mainframe330
 
Posts: 3
Joined: Sun Aug 10, 2014 8:49 am
Has thanked: 0 time
Been thanked: 0 time

Re: JCL to Receive multiple datasets together frm another ma

Postby steve-myers » Mon Aug 11, 2014 2:11 am

You were told quite clearly you cannot do this in quite the way you seem to think it can be done.

If you insist on the XMIT/RECEIVE solution, you must XMIT each PDS data set to a unique container data set, transport each container data set, and then RECEIVE each container data set, one at a time. There is no shortcut.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: JCL to Receive multiple datasets together frm another ma

Postby prino » Mon Aug 11, 2014 10:39 pm

What's wrong with

//RCVJOB JOB (AYANRCV)
//RECV EXEC PGM=IKJEFT01,DYNAMNBR=20
//DD1 DD DISP=SHR,DSN=HLQ.INPUT.XMIT
//DD2 DD DISP=SHR,DSN=HLQ.INPUT2.XMIT
//DD3 DD DISP=SHR,DSN=HLQ.INPUT3.XMIT
//DD4 DD DISP=SHR,DSN=HLQ.INPUT4.XMIT
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
RECEIVE +
INDDNAME(DD1) +
NODISPLAY +
NONAMES
DATASET(HLQ.AYAN.TARGET)

RECEIVE +
INDDNAME(DD2) +
NODISPLAY +
NONAMES
DATASET

RECEIVE +
INDDNAME(DD3) +
NODISPLAY +
NONAMES
DATASET

RECEIVE +
INDDNAME(DD4) +
NODISPLAY +
NONAMES
DATASET
/*


And for what it's worth, the XMIT command can store two datasets into an XMIT dataset, the actual data and a message dataset.If you look at XM on "that" system, you'll see that I use this to create a Windows batch file that allows me to restore PDS members with the z/OS date. :)
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

Re: JCL to Receive multiple datasets together frm another ma

Postby Mainframe330 » Wed Aug 13, 2014 7:15 am

steve-myers wrote:The XMIT command will store 1, and only 1, data set in an output data set.

If you want to send multiple data sets in 1 data set, try to use the ADRDSSU DUMP command to generate a container data set containing multiple data sets, XMIT the container data set, then use RECEIVE to restore the container data set, and ADRDSSU to restore the data sets in the container data set.

In fact, follow this script!
  • Use ADRDSSU to create the container data set.
  • Use TERSE or AMATERSE to compress the ADRDSSU container data set.
  • Forget XMIT/RECEIVE, just transport the compressed container data set.
  • Use TERSE or AMATERSE to expand the compressed container data set.
  • Use ADRDSSU to extract
    the data sets from the container data set.
I've never tried this. I can imagine all sorts of issues trying to restore data sets that were SMS managed on the source system.


Thanks for your input Steve. I have few subsequent questions on this. I know ADRDSSU can dump (copy) multiple datasets into one. But my question is would it be able to do the vice versa, i.e. would ADRDSSU will be able to restore that single datasets into multiple ones? In that case how would I mention separate target dataset so that original ones get restored properly?

When you say transport the dataset are you talking about the following TSO command?
TSO Receive DA('dataset name')
Mainframe330
 
Posts: 3
Joined: Sun Aug 10, 2014 8:49 am
Has thanked: 0 time
Been thanked: 0 time

Re: JCL to Receive multiple datasets together frm another ma

Postby steve-myers » Wed Aug 13, 2014 7:44 am

By "transport" I meant some mechanism to copy data; tape, shared DASD, FTP, XMIT via JESx, Network data mover, what have you. There are many choices. XMIT/RECEIVE is OK. I use it quite a bit myself for small data sets, but I do not regard it as very satisfactory for large data sets since it does not compress data.

Recovering a data set from an ADRDSSU dump data set is a matter of running ADRDSSU with the correct control statements. I am not an ADRDSSU expert. Around 1988 it left a very unsatisfactory taste in my mouth, in terms of its capabilities, performance and usability. I custom wrote a program to replace its intended primary use at the time, which was to copy large numbers of sequential data sets. Since then I have avoided it like the plague.

I will concede many of my colleagues in this forum appear to think well of it.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: JCL to Receive multiple datasets together frm another ma

Postby Robert Sample » Wed Aug 13, 2014 8:39 am

If you use ADRDSSU to dump / copy multiple data sets (sequential, PDS, or VSAM), the original data sets can be restored (individually or in any combination). The restored data sets can retain the original data set names or be given new data set names as needed. The DFSMS bookshelf has a manual on ADRDSSU, giving the MANY options to copy / dump as well as restore data sets. There are some restrictions (for example, note carefully the manual comments on copying the ADRDSSU data set), but overall the utility works quite well -- we used it to create and restore disaster recovery data sets successfully quite a number of times.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post