How to populate a new DATASET in JCL?

JES2/3, JCL, utilities.

Topic author
peeterjoot
New Member
Posts: 9
Joined: Fri Mar 03, 2017 2:01 am
Has thanked: 4 times
Been thanked: 1 time

How to populate a new DATASET in JCL?

Postby peeterjoot » Mon Mar 06, 2017 11:58 pm

If I allocate a DATASET in JCL, either manually, or with IDCAMS, such as:

Code: Select all

//VSAMCR JOB
//DEFINE EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSTERM  DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER (NAME(PJVSAM00.00000000) -
               CYLINDERS(1) VOLUMES(LZ0000) -
               INDEXED KEYS(10 179) -
               RECORDSIZE(240 240) -
               ) -
         DATA (NAME(PJVSAM00.00000000.DATA)) -
         INDEX (NAME(PJVSAM00.00000000.INDEX))
/*


How can I populate that file with some initial content, such as that from an INLINE DD, like SYSIN above, so that I can use that file in a subsequent JCL step?



User avatar

Akatsukami
Global Moderator
Global Moderator
Posts: 105
Joined: Tue Oct 20, 2015 3:20 am
Location: Bloomington, IL
Has thanked: 2 times
Been thanked: 14 times

Re: How to populate a new DATASET in JCL?

Postby Akatsukami » Tue Mar 07, 2017 12:32 am

You need to create it in a step running some program (e.g., *Sort) that writes to it.


"I come to the conclusion that, men loving according to their own will and fearing according to that of the prince, a wise prince should establish himself on that which is in his own control and not in that of others." -- Niccolò Machiavelli

Online
User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1275
Joined: Fri Jun 28, 2013 1:22 am
Location: East Dubuque Illinois
Has thanked: 2 times
Been thanked: 90 times

Re: How to populate a new DATASET in JCL?

Postby Robert Sample » Tue Mar 07, 2017 12:45 am

You can use the IDCAMS REPRO command to copy data into the new dataset.



User avatar

Anuj Dhawan
Founder
Posts: 2393
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Has thanked: 152 times
Been thanked: 66 times

Re: How to populate a new DATASET in JCL?

Postby Anuj Dhawan » Tue Mar 07, 2017 10:38 am

As has been said, REPRO has been favorite when it comes to VSAM:

Code: Select all

//COPYDATA ,'job-name',CLASS=class,TIME=(mm,ss)
// EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=class-name
//indd  DD DSN= ... (the input data set)
//outdd DD DSN= ... (the output data set)
//SYSIN DD *
REPRO -
  INFILE(indd) -
  OUTFILE(outdd)
/*


Thanks,
Anuj


Return to “JCL - Job Control Language.”

Who is online

Users browsing this forum: CommonCrawl [Bot] and 1 guest