syntax of mkdir in JCL or IDCAMS

JES2/3, JCL, utilities.
Post Reply
peeterjoot
Registered Member
Posts: 15
Joined: Fri Mar 03, 2017 2:01 am
Contact:

syntax of mkdir in JCL or IDCAMS

Post by peeterjoot »

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: 1885
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: syntax of mkdir in JCL or IDCAMS

Post by Robert Sample »

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
peeterjoot
Registered Member
Posts: 15
Joined: Fri Mar 03, 2017 2:01 am
Contact:

Re: syntax of mkdir in JCL or IDCAMS

Post by peeterjoot »

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

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “JCL - Job Control Language.”