On Fri, 25 Jun 2010 16:50:23 -0500, Kirk Wolf wrote: > >Since you mentioned the Unix shell vs JCL, why not use both? Here's a >simple example of using the Unix shell with a 'here document' to do >parameter substitution for an instream dataset using JCL parameters: > >// SET NEWGDG=FOO.BAR.MYGDG >// SET GDGLIM=3 >//* >// EXEC PGM=COZBATCH, <<FREE BPXBATCH replacement >// PARM='/NEWGDG=&NEWGDG GDGLIM=&GDGLIM' >//STDOUT DD DSN=&&TEMP,DISP=(NEW,PASS), >// DCB=(RECFM=FB,LRECL=80),SPACE=(CYL,(1,1)) >//STDIN DD * >cat <<EOD > DEFINE GDG(NAME($NEWGDG) - > LIMIT($GDGLIM) - > NOEMPTY - > SCRATCH) >EOD >//* >//DEFGDG EXEC PGM=IDCAMS >//SYSIN DD DSN=&&TEMP,DISP=(OLD,DELETE) >//SYSPRINT DD SYSOUT=* >// > I haven't yet ventured into the Co:Z arena, so I'd:
#! /bin/sh # Could be arguments to script or read in from # a library member. # NEWGDG=FOO.BAR.MYGDG GDGLIM=3 submit <<EOD // //NAME JOB ... //* //DEFGDG EXEC PGM=IDCAMS //SYSIN DD * DEFINE GDG(NAME($NEWGDG) - LIMIT($GDGLIM) - NOEMPTY - SCRATCH) //SYSPRINT DD SYSOUT=* // EOD Fewer steps and no 100-character PARM limit. I do this regularly; it's my modal technique for manipulating JCL. Would other IBM-MAIN contributors predict the modal reaction of customers if I inflicted this on them? Or made fourth-party utilities (however free if unsupported) a prerequisite? >(And if you know the Unix shell, sed, awk, etc you can see how this could be >extended to do all sorts of file processing and symbol substitution in the >context of venerable JCL). > Some, but not so much as I rely on looping and function calls in the shell to shift that elaboration from C/I to shell. Wouldn't it be great if the C/I could run shell scripts (or Rexx, or Perl or ...)? //NAME SHELL,DLM=EOD ... shell commands, executed after substituting JCL symbols, whose stdout is fed back to the C/I input stream. ... EOD (Just seeking the least cognitive dissonance to dinos.) >Of course, it would be much better if we could automatically import JCL >variables in the running program, and weren't limited by the pesky 100 >character PARM= limit. But we have a workaround to the latter.... see >example #6 here: http://dovetail.com/docs/cozbatch/examples.html > A common technique. I suppose that in some cases it threatens the limit of the number of job steps. -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html