                    ANOTHER HELPFUL JCL HINT
                           by Jim Kyle
                      the software factory
                      12101 N. Western View
                  Oklahoma City, OK  73132-9270
 
      Most serious users of LDOS JCL already know how to be
 sure that all required parameters have been supplied, by using
 a header on the JCL file that looks like this:
 
      //. SAMPLE/JCL - 12/14/83 - Jim Kyle
      //IF -f+-t+-d
      //. USAGE: do sample (f=fromfile,t=tofile,d=drive)
      . NOTHING DONE!
      //QUIT
      //END
      append #f#:#d# to #t#:#d# (strip)
      //EXIT
 
      If any one or more of the necessary parameters is
 missing, the JCL compiler executes the //IF...//END code. This
 displays a reminder of the proper syntax to you, so you don't
 even need to keep other notes of how to use the file. The line
 ". NOTHING DONE!" replaces any existing SYSTEM/JCL file's
 content, so you don't get unpleasant surprises.
 
      Although the manual doesn't tell you in so many words
 (and even implies that it can't be done), you can do the same
 sort of thing with a JCL "library" file that has a number of
 different procedures, each identified by a label. If you
 supply a label, the JCL compiler ignores everything that it
 finds *before* the label, then compiles only the lines up to
 the *next* label. If you don't supply any label at all, it
 compiles anything that precedes the first label in the file,
 so here's how to build in your reminder:
 
      //. LIBRARY/JCL - 12/14/83 - Jim Kyle
      //. Must use one of these labels:
      //.     @JCLA    @JCLB    @JCLC
      . NOTHING DONE!
      //QUIT
      @JCLA
      .....code for the first segment.....
      @JCLB
      .....code for the next segment.....
      @JCLC
      .....code for the last segment.....
 
      If you type "do library" with no parameters, you'll get
 the list of acceptable labels. If each of these routines, in
 turn, checks for its own required parameters, you'll have full
 on-line documentation for the most extensive JCL libraries you
 can dream up.
 
      I am presently using this technique to manipulate nested
 PDS files which simulate the UNIX directory and sub-directory
 structure; without JCL the amount of typing required to copy
 out several lower-level PDS files in order to recover one item
 from each would be too much. Each JCL routine, though, is only
 two or three lines, so separate files for each routine waste
 too much space. The library of JCL takes only a couple of
 granules for all 12 routines, and the built-in help feature
 makes it easy to use. Try it; you'll wonder why you waited so
 long!
 
