syntax of mkdir in JCL or IDCAMS

JES2/3, JCL, utilities.
Previous topicNext topic

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

syntax of mkdir in JCL or IDCAMS

Post by peeterjoot » Thu Mar 23, 2017 9:28 pm

I'm able to use JCL and IDCAMS to populate a USS file:

Code: Select all

//PATH JOB 
//CREATE   EXEC PGM=IDCAMS
//UNIX     DD PATH='unixfile',PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// PATHMODE=SIRWXU
//JUNK     DD DATA,DLM=@@
a   
quick
brown
fox 
@@  
REPRO -
  INFILE(JUNK) -
  OUTFILE(UNIX)
/*  
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSTERM  DD SYSOUT=*
Is there an IDCAMS or JCL syntax to do the equivalent to mkdir, so that I can create the file in a subdirectory instead?



User avatar

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

Re: syntax of mkdir in JCL or IDCAMS

Post by Robert Sample » Thu Mar 23, 2017 9:58 pm

From the z/OS 2.1 JCL Reference manual on the PATHOPTS subparameter definitions (emphasis added by me):
OCREAT
Specifies that:

If the file does not exist, the system is to create it. If a directory specified in the pathname does not exist, one is not created, and the new file is not created.
If the file already exists and OEXCL was not specified, the system allows the program to use the existing file.
If the file already exists and OEXCL was specified, the system fails the allocation and the job step.
By the way, you're not the only one to complain about this -- here's 2010 comment on the same inability to create paths in JCL: https://groups.google.com/forum/#!topic ... VbV2pXODuk




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

Re: syntax of mkdir in JCL or IDCAMS

Post by peeterjoot » Thu Mar 23, 2017 11:20 pm

Thanks. From the link you posted, it looks like a STEP that runs BPXBATCH is the way to do it.



Previous topicNext topic

Return to “JCL - Job Control Language.”