Kirk Wolf wrote:
> Kenneth E Tomiak wrote:
>> What are you defining a current JCL symbol to be? Show us an example.
>>
>> On Tue, 12 Jun 2007 15:17:57 -0500, Kirk Wolf <[EMAIL PROTECTED]> wrote:
>>
>>
>>> Does anyone know how to read the current JCL symbols from a program?
>>>
>>> Kirk Wolf
>>> Dovetailed Technologies
>>>

Other than the SAVESYMS command I mentioned last night, another way to
do it is to use the REPLACE option on a "card" file declaration such as
the following snippet of Jol code:

Set RUNTYPE='PROD';

DCL CARDFILE * REPLACE;
%DAY%DAYNO  %RUNTYPE
EOF;

If the day was MONDAY the 14th, then the card would be:
MONDAY  14  PROD

Jol has certain pre-initialized variables, such as DAY, DAYNO, MONTH,
YEAR etc.

The program can read the card image file and use the day and day number
for any purpose it desires, for example to print headings.  This
facility is most often used in Jol commands to create utility control
cards from variable parameters used in the command.  However, this
facility of text replacement is not restricted to to creating parameter
files for utility programs - it can be used for any program.


Another way might to pass some variables to the assembler might be:

SectType='DSECT';    /* note that Case is not important to Jol */
Macro='GENERATE';

DCL ASMIN Card * replace;
       GBLC  &SECTTYP        SECTION TYPE FOR SCHEDULER (CSECT/DSECT)
&SECTTYP SETC  '%SECTTYPE'          SET DEFAULT VALUE FROM SYMBOLIC
       %MACRO                      ISSUE THE MACRO FROM THE SYMBOLIC
EOF;

Then, to assemble, say:

ASM ASMIN ;

What happens is that the % names in the card definition get replaced
with the current values of the symbolics.  So %SECTTYPE will contain
DSECT, and the %MACRO will be replaced by GENERATE.  That is what the
Assembler will see when it is executed.

Finally, one could use the Jol Allocate and WRITE instructions to
dynamically allocate a data set, and write data to it.  A program could
then read that file, and do what it wants.

For example:

  alloc FILE(OUTPUT) TEMP.OUTPUT NEW 5 TRACKS FB 80, 800;
  open file(output) output;
  WRITE file(output) from '%DAY';
  close file(output);


and so on.

Clem

,-._|\  Clement V. Clarke - Author Jol, EASYJCL, EASYPANEL, 370TO486
/  Oz  \ Web: http://www.ozemail.com.au/~oscarptyltd
\_,--.x/ 16/38 Kings Park Road, West Perth, AUSTRALIA, 6005.
    v  Tel (61)-8-9324-1119, Mob 0401-054-155.
       Email: [EMAIL PROTECTED]

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to