__le_ceegtjs() — Retrieve the value of an exported JCL symbol

Standards

Standards / Extensions C or C++ Dependencies

Language Environment

both AMODE 64

Format

#include <__le_api.h>

void __le_ceegtjs(_INT4 * function_code, 
                  _VSTRING * symbol_name, 
                  _CHAR255 * symbol_value, 
                  _INT4 * value_length, 
                  _FEEDBACK * fc);

General description

The __le_ceegtjs() function retrieves and returns to the caller the symbol value and length of the requested exported JCL symbol.

Parameter
Description
function_code
A fullword integer containing the function code of the following value:
1
Retrieve the value and its associate length of an exported JCL symbol.
symbol_name
A halfword length-prefixed character string(VSTRING), representing the name of an exported JCL symbol to be retrieved.
symbol_value
A 255-byte fixed-length string. On return from this service, the symbol_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
A fullword integer containing the length of the value of the specified JCL symbol.
fc
A 16-byte Feedback Code indicating the results of this function.
Table 1. Feedback Codes for __le_ceegtjs()
Code Severity Message Number Message Text
CEE000 0 - - The function 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 failed with return code return_code and reason code reason_code.

Usage notes

  1. Lower case characters in the symbol_name will be converted to upper case by the __le_ceegtjs function.
  2. For more information about JCL symbols and their usage, see "Using System Symbols and JCL symbols" in z/OS MVS JCL Reference.

Example

CELEBL31
/* CELEBL31

   This example retrieves the value of an exported JCL symbol.

*/
#include <stdio.h>
#include <string.h>
#include <__le_api.h>

int main()
{
   _FEEDBACK fc;
   _INT4 funcode;
   _CHAR255 symvalue;
   _VSTRING symname;
   _INT4 valuelen;
   char *symbol="SYM1";
   
   /* Setting the function code */
   funcode=1;
   
   /* Preparing the JCL symbol name */
   symname.length=strlen(symbol);
   memcpy(symname.string, symbol,strlen(symbol));

   /* Retrieving the value of the JCL symbol */ 
   __le_ceegtjs(&funcode,&symname,symvalue,&valuelen,&fc);
   if( fc.tok_sev > 0) {
      printf("__le_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);
}
Output
Use the following JCL to run CELEBL31:
//JOB1     JOB    FELE,MSGLEVEL=(2,0)                               
//STEP1    EXEC   PGM=CELEBL31                                      
//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.

Related information