VGET
Command | Parameters |
---|---|
VGET | Variable name|(var1....var2....var3...varn) [INTO(Variable)] [LOCAL|SHARED|PROFILE] [DECRYPT(xyz)] DELIM( ) TARGET(ssid) |
The following table describes the parameters:
Parameter | Function | Notes |
---|---|---|
Variable name|(var1 ... var2...varn) | Name of one or more variables to copy | When you specify more than one variable, you must enclose the variable names in parentheses. Each variable name can be up to 128 characters in length. You can use the wildcard characters plus sign (+) and asterisk (*). The plus sign represents one character and the asterisk represents multiple characters. EXEC processing ignores the INTO parameter when you specify a variable name with a wildcard character. |
INTO | An optional keyword that you can use in conjunction with the VDCL command to map a string of characters into a list of individual variables | The variable to receive the values should have been declared with the IMFEXEC VDCL statement. |
Pool identifier | The pool in which the designated variables reside | The identifier is one of the following pools:
|
DECRYPT(xyz) | Specifies a character string that can be used for decrypting variable contents | This parameter must be used in conjunction with the ENCRYPT parameter on an IMFEXEC VPUT command at the same time. If this parameter is not used correctly, the contents of the data will not match. The character string can be 2-255 characters long. Enclose the character string in single quotation marks if the string contains blanks. Only individual variables can be decrypted. List variables cannot be decrypted. Refer to VPUT for information about the ENCRYPT parameter. |
DELIM( ) | Allows you to specify characters (instead of blanks) to delimit words or characters into separate variables | Blank is the default. |
TARGET | Allows you specify the BBI-SS PAS ID of another BBI-SS PAS You can then VGET variables from one BBI-SS PAS to another BBI-SS PAS that communicates with it. | The TARGET keyword can be used with IMFEXEC commands VDEL, VGET, and VPUT. |
Condition codes are listed in the following table:
Value | Description |
---|---|
0 | Command was executed successfully. |
8 | One of the following conditions is true:
|
12 | TARGET was not found in BBPARM member BBIJNT00. |
16 | Node was not available. |
16 | Sysplex variable name is too long (exceeds 15 characters) |
16 | Invalid variable name |
16 | Invalid syntax |
20 | One of the following conditions is true:
When using the TARGET keyword to VPUT a variable to another target, there is a limit of (approximately) 7000 bytes of data that can be sent to another target. This limit includes both the variable name and variable value. |
Additional usage notes for the VAR parameter
The IMFEXEC VGET var1 and so on) command retrieves variables and stores the variables names in TSO variables IMFVAR1 through IMFVARnnnn, where nnnn is the last variable. The IMFVAR variable contains the value of nnnn). If a variable name contains a wildcard character but there are no matching names in the pool, that name is not stored to a IMFVARnnnn variable.
Example 1
This example displays the contents of the EXECs SHARED variable pool.
It uses the VLST command to retrieve the names of all variables in that pool. It then performs VGETs them one after the other and displays their contents.
'IMFEXEC VLST * SHARED"
DO I = 1 TO IMFNOL
'IMFEXEC VGET LINE"I 'LOCAL"
'IMFEXEC VGET" VALUE('LINE'I) "SHARED'
'IMFEXEC MSG '.."VALUE(VALUE('LINE'I))"''
END
CLIST example:
SET I=1
DO WHILE &I LE &IMFNOL
IMFEXEC VGET LINE&I LOCAL
IMFEXEC VGET &SYSNSUB(2,&&LINEI) SHARED
IMFEXEC MSG ..&SYSNSUB(2,&&LINEI)
SET I=&I+1
END
Example 2
The VDCL command specifies that CICSL20 is a list of 12 variables, V1 to V12.
The VGET command maps the data returned for LINE20 into the 12 variables. The local variables, V1 through V12, can now be processed by other commands within the EXEC.
"IMFEXEC VDCL CICSL20 LIST(V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12)"
"IMFEXEC VGET LINE20 INTO(CICSL20) LOCAL"
CLIST example:
IMFEXEC VGET LINE20 INTO(CICSL20) LOCAL
Example 3
This example shows how to use the IMFEXEC VPUT ENCRYPT and IMFEXEC VGET DECRYPT parameters.
Both parameters specify ('DATASTREAM'), which ensures that when the variable ABC is decrypted, the contents of the variable are accurate.
ABC=SUBSTR(THIS IS A DATA ENCRYPTION EXAMPLE)
"IMFEXEC VPUT ABC SHARED ENCRYPT('DATASTREAM')"
"IMFEXEC VGET ABC SHARED DECRYPT('DATASTREAM')"
CLIST example
IMFEXEC VPUT ABC SHARED ENCRYPT('DATASTREAM')
IMFEXEC VGET ABC SHARED DECRYPT('DATASTREAM')
Example 4
The following example shows the IMFXEC VGET command using a wildcard character:
"IMFEXEC MSG 'QIMFID:" QIMFID"'"
"IMFEXEC MSG 'QSAFID:" QSAFID"'"
"IMFEXEC MSG 'QSMFID:" QSMFID"'"
Sample output:
QIMFID: JB73
QSAFID: BAOSTC
QSMFID: SJSD
Example 5
The following example shows the IMFEXEC VGET command using a wildcard character and how the command retrieves and displays IMFVARnnnn TSO variables:
PARSE UPPER ARG EXECNAME FILLER
/* -------------------------------------------------------------- */
/* Issue the IMFEXEC VGET service */
/* -------------------------------------------------------------- */
"IMFEXEC VGET (Q*ID CSMREPDS) SHARED"
VGET_IMFCC = IMFCC
/* -------------------------------------------------------------- */
/* Report on: */
/* - IMFCC from IMFEXEC VGET */
/* - IMFVARCT (number of variable names processed by VGET) */
/* -------------------------------------------------------------- */
"IMFEXEC MSG '+'"
"IMFEXEC MSG '+ "LEFT('IMFCC for VGET',14)" is "VGET_IMFCC"''
"IMFEXEC MSG '+ "LEFT('IMFVARCT',14)" is "IMFVARCT"'"
"IMFEXEC MSG '+'"
/* -------------------------------------------------------------- */
/* Report on: */
/* - Variable values returned from IMFEXEC VGET */
/* - Variable names processed by IMFEXEC VGET */
/* -------------------------------------------------------------- */
DO N = 1 TO IMFVARCT
"IMFEXEC MSG '+ "LEFT('IMFVAR'||N,14)||,
" is ''"VALUE(LEFT(IMFVAR||N,LENGTH(IMFVAR||N)))"''"
"IMFEXEC MSG '+ "LEFT('it contains',17)||" ''"||,
VALUE(LEFT(VALUE(IMFVAR||N),LENGTH(VALUE(IMFVAR||N))))"''"
"IMFEXEC MSG '+'"
END
/* -------------------------------------------------------------- */
/* Indicate the end of the EXEC and then return to the caller. */
/* -------------------------------------------------------------- */
"IMFEXEC MSG '+ End of EXEC'"
"IMFEXEC EXIT CODE(0)"
Sample output:
+
+ IMFCC for VGET is 0000
+ IMFVARCT is 6
+
+ IMFVAR1 is 'QSAFID'
+ it contains 'TSGSTC'
+
+ IMFVAR2 is 'QCASID'
+ it contains 'KZC2'
+
+ IMFVAR3 is 'QIMFID'
+ it contains 'KMZ2'
+
+ IMFVAR4 is 'QIMSID'
+ it contains ''
+
+ IMFVAR5 is 'QSMFID'
+ it contains 'SJSC'
+
+ IMFVAR6 is 'CSMREPDS'
+ it contains 'BAOKMZ.KMZ2.BBIREPS'
+
+ End of EXEC