PreviousNext
Help > XML Easycom > Request XML stream > Define tag
Define tag

 Define tag is used to load procedure definition from external PCML stream files, from RPG ILE source files, or from immediate PCML or simplified RPG.

Define tag can be expanded with the following elements.

 

<define>

    [ <file   type="source type"

             [ pf-src="RPG source member" ]

             [ stmf="RPG or PCML source" ]

    /> ]

    [ <pcml version="1.0"> ... </pcml> ]

    [ < S-RPG > ... </S-RPG> ]

</define>

 

Tag/Attribute

Attribute Value

Description

<file>

tag

When structure and procedure definition is stored in a source file member or a stream file, <file> sub tag is used, with following attributes:

     type

     pf-src

     stmf

 

Type

PCML
RPG

Attribute of <file> tag.

Set the type of source stored in the source file member or stream file.

Possible values are:

     PCML: Description is given in PCML format.
PCML description is stored in the IFS file referenced to by stmf attribute.

     RPG: Description is given in RPG source, stored in the source file member referenced to by pf-src attribute, or in the stream file referenced to by stmf.

 

pf-src

Source file member

Path to the file member containing RPG ILE source.

Example:

<define><file type="RPG"
pf-src="EASYCOMXM3/QRPGLESRC(CVTNW_H)" />

 

 

stmf

IFS path

Path to PCML or RPG ILE source stored in the IFS.

 

<pcml>

tag

Using this tag, PCML description is not stored in an external file. It is directly embeded in the current XML request.
<pcml> tag contains the full pcml description for structures and programs.

See example here after.

 

<s-rpg>

tag

"Simplified RPG" is like RPG. It accepts only definition statements. There is no column constraint. Each statement is terminated by a semi colon (;).

 

 

Example of <pcml> tag embedded in XML Easycom stream.

<?xml version="1.0" encoding="ISO-8859-1" ?>

<Easycom>

<define>

<pcml version="1.0">

  <!-- PCML source for calling "Retrieve user Information" (QSYRUSRI) API -->

  <!-- Format USRI0150 - Other formats are available -->

  <struct name="usri0100">

    <data name="bytesReturned"type="int"    length="4"  usage="output"/>

    <data name="bytesAvailable"     type="int"    length="4"  usage="output"/>

    <data name="userProfile"  type="char"   length="10" usage="output"/>

    <data name="previousSignonDate" type="char"   length="7"  usage="output"/>

    <data name="previousSignonTime" type="char"   length="6"  usage="output"/>

    <data   type="byte"   length="1"  usage="output"/>

    <data name="badSignonAttempts"  type="int"    length="4"  usage="output"/>

    <data name="status" type="char"   length="10" usage="output"/>

    <data name="passwordChangeDate" type="byte"   length="8"  usage="output"/>

    <data name="noPassword"   type="char"   length="1"  usage="output"/>

    <data   type="byte"   length="1"  usage="output"/>

    <data name="passwordExpirationInterval" type="int"    length="4"  
    usage="output"/>

    <data name="datePasswordExpires" type="byte"   length="8"  usage="output"/>

    <data name="daysUntilPasswordExpires"   type="int"    length="4"  
    usage="output"/>

    <data name="setPasswordToExpire"  type="char"   length="1"  usage="output"/>

    <data name="displaySignonInfo"    type="char"   length="10" usage="output"/>

  </struct>

 

  <!-- Program QSYRUSRI and its parameter list for retrieving USRI0100 format -->

  <program name="qsyrusri" path="QSYRUSRI">

    <data name="receiver"     type="struct"  struct="usri0100"  usage="output"/>

    <data name="receiverLength" type="int" length="4"  usage="input" init="84"/>

    <data name="format"   type="char"  length="8" usage="input" init="USRI0100"/>

    <data name="profileName"  type="char"  length="10" usage="input" 
    init="*CURRENT"/>

    <data name="errorCode"  type="int"  length="4"  usage="input"  init="0"/>    

  </program>

</pcml>

</define>

</Easycom>

 

Simplified RPG Syntax:

 

Simplified RPG accepts only declaration statements, and compiler directives.

See additional information about Simplified RPG.

 

Example of <s-rpg> tag.

<?xml version="1.0" encoding="ISO-8859-1" ?>

<Easycom>

  <define>

    <s-rpg>

      DS_CUST   E DS  extname(SP_CUST:RSP_CUST);

      PSPCUST   PR;

        Result    LIKEDS(DS_CUST);

        TERM1     5S 0;     

    </s-rpg>

  </define>

</Easycom>

 

RPG and PCML sources contain structure and program definitions. Definitions are maintained for the all job life.

It is recommended to not run twice a <define> for the same RPG or PCML source.