Forget all those Irish commands (OGET, OPUT, etc.) and start unsing UNIX commands. Here are two JCL's I'm using to run UNIX commands in batch: // EXPORT SYMLIST=*// SET DIR='newdir'//UNIXCMDS EXEC PGM=BPXBATCH //STDIN DD DUMMY //STDOUT DD SYSOUT=* //STDERR DD SYSOUT=* //SYMRESDD DD SYSOUT=* //STDPARM DD *,SYMBOLS=(JCLONLY) SH cd /some/directory ; ls -l ; mkdir -m 700 &DIR./*
Note that STDPARM is the BPXBATCH vatiant of PARMDD, and don't confuse them. You start with the usual "SH" to tell BPXBATCH to run a shell. All the rest of STDPARM is input to that shell, so you need to adhere to shell command line syntax. Chain multiple commands with the ";". Note also that you must not try to insert comment, because the first # will start a comment that goes to the end of STDPARM. Advantage: You can user JCL symbols (and if your jobclass allows it, also system symbols) in the UNIX commands. The second job is solving the problem of running commands via "su" in batch. Its not perfect, but mostly does the trick for me. First, there is a JCL procedure: //BPXSU PROC SOUT='*',TMP='tmp-command-file-for-BPXSU-job' //INPUT EXEC PGM=IEBGENER //SYSPRINT DD DUMMY //SYSIN DD DUMMY //SYSUT1 DD DDNAME=COMMANDS //SYSUT2 DD PATH='/tmp/&SYSUID-&TMP', // PATHDISP=(KEEP,DELETE), // PATHOPTS=(OWRONLY,OCREAT,OEXCL), // PATHMODE=(SIRUSR,SIWUSR) //EXECUSS EXEC PGM=BPXBATCH,PARM='SH su' //STDOUT DD SYSOUT=&SOUT. //STDERR DD SYSOUT=&SOUT. //STDIN DD PATH='/tmp/&SYSUID-&TMP', // PATHDISP=(DELETE,DELETE) //STDPARM DD DUMMY Second, here is how to use it: // EXPORT SYMLIST=*// SET FILE='somefile'//UNIXCMDS EXEC BPXSU//COMMANDS DD *,SYMBOLS=(JCLONLY) ls -l ; chown foo:bar &FILE./* The rules for COMMANDS are similar to the above. Note that this is STDIN, not STDPARM, so the "SH" is not need. Also, fi system symbols are allowed, the you can make the temp file name more unique using date, time or other system symbols. -- Peter Hunkeler ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN