How to populate a new DATASET in JCL?

JES2/3, JCL, utilities.
Previous topicNext topic

Topic Author
peeterjoot
Registered Member
Posts: 15
Joined: Fri Mar 03, 2017 2:01 am

How to populate a new DATASET in JCL?

Post by 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: 119
Joined: Tue Oct 20, 2015 3:20 am
Location: Bloomington, IL

Re: How to populate a new DATASET in JCL?

Post by 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

User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1338
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
Zodiac: Virgo

Re: How to populate a new DATASET in JCL?

Post by 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: 2611
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: How to populate a new DATASET in JCL?

Post by 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

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

Previous topicNext topic

Return to “JCL - Job Control Language.”