PreviousNext
Help > API Functions > Program and Procedure calls > i5_XmlLoadDefinition
i5_XmlLoadDefinition

 

This function loads Procedure or Program definitions from RPG or PCML source files.

 

   bool i5_XmlLoadDefinition (string Source_type, string Source_File[, resource Connection ])

 

 

Parameters

 

Source_Type

Type of source provided in the source file.
Possible values are:

     PCML: Definition is in PCML format, stored in an IFS stream file.

     RPG: Definition is taken from an RPG ILE source, stored as a file member, or a stream file.
If file path has the form "/dir/…/file", then file is a stream file

Source_File

Path to a stream file, or source file member.

Connection

Easycom Connection - Result of i5_connect() or i5_pconnect().

 

 

Details

 Procedure and program definitions are loaded from external files and stored in the current Easycom job.

 

From an RPG source file, only definition statements are used to define procedures (D cards).

Main entry point defined by "*ENTRY PLIST" will be used only if it is at the beginning of the C cards.

Compiler directives such as /COPY, /IF are valid for Easycom.

 

Examples

 

Example 1 : Load Structure and Procedure definitions from RPG source.

 

 

$ret = i5_XmlLoadDefinition ("RPG", 'EASYCOMXMP/QRPGLESRC,CVTNW_H');

if (!$ret)

{

                   print_r("i5_ XmlLoadDefinition error : ".i5_errormsg().'<br/>');

}

else

{

                   $ret = i5_XmlBindSrvPgm ("XMPSRVPGM"); 

                   $ArrayIn = array('LIMIT'=>150, 'DECV'=>12345);

                   $ArrayOut = i5_XmlCallProgram ("FCVTNW", $ArrayIn, "RetVal");

                   echo 'Return value = '.$RetVal.'<br>';

}

 

Example 2 : Load Structure and Procedure definitions from PCML.

 

 

$ret = i5_XmlLoadDefinition  ("PCML"
               
’/usr/local/easycom/PHP/Samples/QGYOLAUS.pcml');

 if (!$ret)

{

                   print_r("i5_ XmlLoadDefinition error : ".i5_errormsg().'<br/>');

}

 

 

 

Return

True / False.

 

See also

i5_XmlBindSrvPgm

i5_XmlCallProgram

i5_XmlDefine

i5_XmlExecRequest