Browse Prior Art Database

Interpretive Language Processor Support for Os/400 CL Command

IP.com Disclosure Number: IPCOM000119221D
Original Publication Date: 1991-Jan-01
Included in the Prior Art Database: 2005-Apr-01
Document File: 6 page(s) / 260K

Publishing Venue

IBM

Related People

Babka, JJ: AUTHOR [+3]

Abstract

A method by which an AS/400* CL command can return a value to a Procedures Language 400/REXX program is disclosed. The method allows the program to identify the REXX variable to receive the return value. In addition, the method handles data type conversion, automatically converting the return value from the data type of the command to the character string format required by the REXX program.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 24% of the total text.

Interpretive Language Processor Support for Os/400 CL Command

      A method by which an AS/400* CL command can return a
value to a Procedures Language 400/REXX program is disclosed.  The
method allows the program to identify the REXX variable to receive
the return value.  In addition, the method handles data type
conversion, automatically converting the return value from the data
type of the command to the character string format required by the
REXX program.

      Procedures Language 400/REXX (hereafter referred to as REXX) is
the AS/400 implementation of the SAA Procedures Language CPI.  A
major function of REXX is the ability to execute AS/400 CL commands
from within a REXX program.  A special capability of a set of
important CL commands is the ability for each of these commands to
return one or more values.  When such a CL command is executed from
within a REXX program, each return value needs to be returned to a
REXX variable so it can be used by the program.  Moreover, each value
needs to be in the REXX character string format. Thus, the value
needs to be converted automatically from the data type of the CL
command to the REXX character data type.

      The method that is about to be described is referred to as
Pseudo-CL Variable support within the REXX documentation. An
important aspect of this support is that it is active only when the
current command environment is specified by the user to be the CL
command environment.  REXX supports different command environments
and allows the user to change the command environment dynamically.
If the current command environment is not CL, the method does not
infer with what the user may wish to do in these other environments.

      The method consists of two parts:
1.  A means for the REXX programmer to specify each REXX variable
that is to receive a return value from a command.  This is basically
a syntactical convention that is supported by the REXX interpreter.
2.  An interface between the REXX interpreter and the Command
Analyzer component of the OS/400*.  This is a programming interface
that allows pertinent information, concerning a CL command that is
about to be executed, to be passed between the REXX interpreter and
Command Analyzer.
      The details of the two components of the method follow:

      Rexx Syntax for the Specification of Pseudo-CL Variables.
Within a REXX program, a CL command can be specified as a literal
character string, which is taken as a constant value that represents
the CL command, or as an expression.  When the command is given as an
expression, the REXX interpreter first evaluates the expression which
results in a final character string which is then taken to be the CL
command.  In either case, for each parameter of the command that can
return a value, the final command string must identify the REXX
variable that is to receive the return value.  Each such REXX
variable must be specified using the following syntax:
- ...