You are on page 1of 4

4.

7 Examples of Using Direct Calling

Page 1 of 4

4.7 Examples of Using Direct Calling

The functions and processes used by these examples are a part of the shipped Demonstration Personnel System. All examples execute on an System i with a version of OS/400 at V1R3M0 or higher. The examples are provided with the LANSA Product. The source is stored in file DC@F28 in the LANSA Data Library with the following member names: UD@FUNC1 UD@FUNC2 UD@FUNC3 UD@FUNC4 UD@PROC1 UD@PROC2 UD@PROC3 UD@PROC4 Call a LANSA Function using RPG/400 Call a LANSA Function using Control Language (CLP) Call a LANSA Function using ILE RPG Call a LANSA Function using Control Language (CLLE) Call a LANSA Process using RPG/400 Call a LANSA Process using Control Language (CLP) Call a LANSA Process using ILE RPG Call a LANSA Process using Control Language (CLLE)

The source members for these programs for RPG/400(UD@FUNC1) & ILE RPG (UD@FUNC3) can be found in file DC@F28 in the LANSA Data Library. 4.7.1 Executing the LANSA INQUIRE Function with RPG

The sample RPG members are an examples of directly calling a LANSA function. They show the basics necessary to set up all relevant information for a function. The function is executed in English. The programs UD@FUNC1 & UD@FUNC3 call the LANSA function INQUIRE - 'Browse/Maintain Employee and Skill Files' and pass to the function, via the exchange list, a value for the field EMPNO 'Employee number'. Note: The employee number will only be exchanged if the INQUIRE function has been created with access to 3GL exchange list flag set on. 4.7.2 Executing the LANSA INQUIRE Function with CL

The source members for these programs for CLP (UD@FUNC2) & CLLE (UD@FUNC4) are supplied in file DC@F28 in the LANSA Data Library. These examples perform exactly the same processing as the Executing the LANSA INQUIRE Function with RPG sample code, except these programs have been written using Control Language (CLP & CLLE). The function is executed in English.

file:///C:/Users/patrick.fleming/AppData/Local/Temp/~hh7F57.htm

3/13/2012

4.7 Examples of Using Direct Calling

Page 2 of 4

4.7.3 Executing the LANSA PSLSYS Process with RPG

The source members for these programs for RPG/400 (UD@PROC1) & ILE RPG (UD@PROC3) are supplied in file DC@F28 in the LANSA Data Library. The sample RPG members are an examples of directly calling a LANSA Process. They show the basics necessary to set up all relevant information to run a LANSA Process. The programs UD@PROC1 & UD@PROC3 call the LANSA Process PSLSYS - 'Personnel System'. The process is executed in English. 4.7.4 Executing the LANSA PSLSYS Process with CL

The source members for these programs for CLP (UD@PROC2) & CLLE (UD@PROC4) is supplied in file DC@F28 in the LANSA Data Library. These examples perform exactly the same processing as the Executing the LANSA PSLSYS Process with RPG sample code, except these programs have been written using Control Language (CLP & CLLE). The process is executed in French. 4.7.5 Sample Set up of Process Information - PR@IDS

The following RPG/400 code shows the necessary field settings for the Process Information data structure - PR@IDS. I* Program Information Data Structure I* I$PID I I* C* Clear the exchange list C* C C C* Z-ADD0 Z-ADD1 PR@NXL PR@NXP SDS 200 *PROGRAM $PGMNM

file:///C:/Users/patrick.fleming/AppData/Local/Temp/~hh7F57.htm

3/13/2012

4.7 Examples of Using Direct Calling

Page 3 of 4

C C C* C C C C* C* C C C* C C* C C C C C C C C C C C C

MOVEL<function>PR@FUN MOVEL<fdesc> PR@FUD description MOVEL*BLANKS PR@NXT MOVEL*BLANKS PR@NXD MOVEL<ptype> PR@TYP

Function name Function

Process type

MNU,FUN,CMD, HLP, or EXT MOVEL<process> PR@PRO MOVEL<pdesc> PR@PRD description MOVEL'L' PR@RCL LIGHT = L MOVEL'DIS' PR@MDE Heavy = N, Process name Process

MOVEL*BLANKS PR@VER MOVELSA@KEH PR@CEX MOVELSA@KCN PR@CMN MOVELSA@KMS MOVELSA@KAD PR@CDM PR@CAD

MOVELSA@KCH PR@CCH MOVELSA@KDL PR@CDL MOVEL'00' MOVEL'00' MOVEL'00' MOVEL'00' PR@CU1 PR@CU2 PR@CU3 PR@CU4

file:///C:/Users/patrick.fleming/AppData/Local/Temp/~hh7F57.htm

3/13/2012

4.7 Examples of Using Direct Calling

Page 4 of 4

C C C C C C C C C* C*

MOVEL'00'

PR@CU5

MOVE *BLANKS PR@CD1 MOVE *BLANKS PR@CD2 MOVE *BLANKS PR@CD3 MOVE *BLANKS PR@CD4 MOVE *BLANKS PR@CD5 MOVEL*BLANKS PR@KEY MOVEL*BLANKS PR@ELK

C* $PGMNM is the name of this program C* from the Program Information Data Structure (PIDS) C* C C C C C MOVEL$PGMNM MOVE '01' MOVEL'Y' MOVEL'Y' MOVE 'N' PR@RMQ

PR@NIC PR@RQR PR@SAA PR@EPR

file:///C:/Users/patrick.fleming/AppData/Local/Temp/~hh7F57.htm

3/13/2012

You might also like