FLAM® Issue Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000865FL51.1 FLCLpublic2017-03-19 10:252017-03-22 09:00
ReporterFalk Reichbott 
Assigned ToFalk Reichbott 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusresolvedResolutionfixed 
PlatformSystem zOSz/OSOS VersionV2R20
Product Version5.1.14 
Target Version5.1.16Fixed in Version5.1.15 
Summary0000865: Support replacement of JCL variables like environment variables in FLCL control statements
DescriptionCurrently we support the replacement of environment variables in control statements and strings.

file='<HOME>/test.txt'

For JCL it would be useful to support also JCL variables like environment variables.

//SET FLQ=HUGO
//PARM DD *
read.file=<FLQ>.TEST.TXT
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0001092)
Falk Reichbott (administrator)
2017-03-19 10:33

I think he's wanting to get the SET values at run time. I don't think it's possible because all symbolic substitution is performed when the JCL text is read in. For example: there's an example in the manual that shows SET text altering a line such that what was a comment is turned into part of an executable statement (or the other way around, can't remember). Values are not carried thru to execution time. It's kind of the macro pre process in c/c++ if you're familar with that.

Read more: http://ibmmainframes.com/about57552.html#ixzz4blM62Jfk [^]
(0001093)
Falk Reichbott (administrator)
2017-03-19 10:39

CEEGTJS—Retrieves the value of an exported JCL symbol

CEEGTJS retrieves and returns to the caller the symbol value and length of the requested exported JCL symbol.

Read syntax diagramSkip visual syntax diagram
Syntax

>>-CEEGTJS--(--function_code--,--symbol_name--,--symbol_value--->

>--,--value_length--,--fc--)-----------------------------------><

function_code (input)
    A fullword integer that contains the function code of the following value:

    1
        Retrieves the value and its associated length of an exported JCL symbol.

symbol_name (input)
    A halfword length-prefixed character string (VSTRING), representing the name of an exported JCL symbol to be retrieved.
symbol_value (output)
    A 255-byte fixed-length string. On return from this service, the ssymbol_value contains the value of the exported JCL symbol. If the length of the exported JCL symbol is shorter than 255 characters, the returned string is padded with blanks.
value_length (output)
    A fullword integer that contains the length of the value of the specified JCL symbol.
fc (output)
    A 12-byte feedback code, optional in some languages, that indicates the result of this service. If you omit this parameter, refer to Invoking callable services for the appropriate syntax to indicate that the feedback code was omitted.

    The following symbolic conditions can result from this service:
    Code Severity Message number Message text
    CEE000 0 — The service completed successfully.
    CEE3L9 0 3753 The input symbol cannot be found in the current job step.
    CEE3LA 3 3754 Incorrect parameters detected.
    CEE3QS 1 3932 The system service service failed with return code return_code and reason code reason_code.

Usage notes

    Lowercase characters in the symbol_name are converted to uppercase by CEEGTJS.
    For more information about JCL symbols, refer to the topic on system symbols and JCL symbols in z/OS MVS JCL Reference.

Examples

    This example uses CEEGTJS to retrieve the value of an exported JCL symbol.

    /*Module/File Name: EDCGTJS */
    /*********************************************************************/
    /* */
    /* THIS EXAMPLE CALLS CEEGTJS TO RETRIEVE THE VALUE OF AN EXPORTED */
    /* JCL SYMBOL. */
    /* */
    /*********************************************************************/
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <leawi.h>
    #include <ceeedcct.h>

    int main(void) {
       _FEEDBACK fc;
       _INT4 funcode;
       _CHAR255 symvalue;
       _VSTRING symname;
       _INT4 valuelen;
       char *symbol="SYM1";
       
       /* Setting the function code */
       funcode=1;

     /* Preparing the JCL symbol */
       symname.length=strlen(symbol);
       memcpy(symname.string, symbol,strlen(symbol));

    /* Retrieving the value of the JCL symbol */
       CEEGTJS(&funcode,&symname,symvalue,&valuelen,&fc);
       if( _FBCHECK (fc, CEE000) !=0) {
        printf("CEEGTJS failed with message number %d\n",
             fc.tok_msgno);
        exit(1);
      }
       symvalue[valuelen]='\0';
       printf("The value of JCL symbol %s is %s. The length
              of the value is %d\n",symbol,symvalue,valuelen);
    }

    Use the following JCL to run EDCGTJS:

    //JOB1 JOB FELE,MSGLEVEL=(2,0)
    //STEP1 EXEC PGM=EDCGTJS
    //E1 EXPORT SYMLIST=(SYM1,SYM2,SYM3)
    //S1 SET SYM1=XXXX
    //S2 SET SYM2=YYYY
    //STEPLIB DD DSN=USER.LOADLIB,DISP=SHR
    //SYSPRINT DD SYSOUT=*
    //SYSOUT DD SYSOUT=*

    Running this example would produce the following output:

    The value of JCL symbol SYM1 is XXXX. The length of the value is 4.
(0001095)
Falk Reichbott (administrator)
2017-03-22 09:00

Since z/OS 2.1 a new service (CEEGTJS) is available to determine the
values for exported JCL symbols in the application. The service is
called dynamically and the language environment must be in the steplib
concatenation to use it. If the service not available the exported JCL
symbols cannot be used. If the environment variable replacment failed
the exported JCL symbols are tried. This feature allows you to use
exported JCL symbols in the control statements of FLCL like environment
variables. This is mainly useful to build powerful procedures.

------------------------------------------------------------------------
 //E0 EXPORT SYMLIST=(CHAROUT,HASHALGO,HASHLEN)
 //S1 SET CHAROUT=IBM1141
 //S2 SET HASHALGO=SHA512
 //S3 SET HASHLEN=128
 //CONV EXEC PGM=FLCL,PARM='CONV=DD:PARM'
 //STEPLIB DD DSN=FLAM.LOAD,DISP=SHR
 //SYSPRINT DD SYSOUT=*
 //SYSOUT DD SYSOUT=*
 //PARM DD *,SYMBOLS=JCLONLY
 READ.RECORD(FILE=DD:INPUT)
 WRITE.TEXT(FILE=DD:GZIP COMP.GZIP()
   HASH(OUTPUT=DD:HASH
        FORMAT=HEX
        CUT=<HASHLEN>/2 # important out-bytes=HASHLEN*2 if hex #
        CCSID=<CHAROUT>
        ALGO=&HASHALGO.
        )
 )
 //INPUT ...
 //GZIP ...
 //HASH ...DCB=(RECFM=FB,LRECL=&HASHLEN.)...
------------------------------------------------------------------------

The environment varibales have a higher priority. If we have an
environment varibale with the same name as an exported JCL symbol,
then value of the environment variable is used. Also system variables
available as JCL symbols (if SYSSYM=ALLOW is specified in the class
definition) can be exported and used in the control statements. To
export all JCL symbols for an application you can use 'SYMLIST=*'. You
can also use the "&name." replacment of JESS (PARAM DD *,SYMBOLS=JCLxxxx) if inline coding used. But for an external parameter file the JCL symbols are only
available with "<name>".

- Issue History
Date Modified Username Field Change
2017-03-19 10:25 Falk Reichbott New Issue
2017-03-19 10:25 Falk Reichbott Status new => assigned
2017-03-19 10:25 Falk Reichbott Assigned To => Falk Reichbott
2017-03-19 10:33 Falk Reichbott Note Added: 0001092
2017-03-19 10:39 Falk Reichbott Note Added: 0001093
2017-03-20 15:18 Ulrich Schwab Summary Support replacment of JCL variables like environment variables in FLCL control statements => Support replacement of JCL variables like environment variables in FLCL control statements
2017-03-20 15:18 Ulrich Schwab Description Updated View Revisions
2017-03-22 09:00 Falk Reichbott Note Added: 0001095
2017-03-22 09:00 Falk Reichbott Status assigned => resolved
2017-03-22 09:00 Falk Reichbott Fixed in Version => 5.1.15
2017-03-22 09:00 Falk Reichbott Resolution open => fixed


Copyright © 2000 - 2024 MantisBT Team
Powered by Mantis Bugtracker