Using Amper Variables Within a Subroutine
To use amper variables within a subroutine:
- An ampersand
(&) must be included as the first character before the amper variable
name.
- Single quotation
marks cannot be placed around amper variables.
- A second amper
variable to code the length of the value (in accordance with the format
needed to execute a subroutine) must be used with each amper variable.
Example: Using Amper Variables for the Burst Value and E-mail Address Field
You
can use amper variables in place of hard coding a value that is
passed as a parameter to a subroutine. This example uses the -SET
Dialogue Manager command to supply:
- Values to the parm
argument.
- The length
of the parm argument (parm_length).
- The variables
&VAR1 and &VAR2 are then substituted for these arguments.
FILEDEF SUBLOG DISK D:\ibi\srv77\wfs\catalog\sublog.ftm
-RUN
-SET &VAR1='COUNTRY=FRANCE';
-SET &VAR2=14;
-SET &SUBERR = DSTMEM(
- 'userid',6,
- 'mypass',6,
- 'ibiwnt:3794',11,
- 'Managers',8,
- 'A',1,
- 'listownerId',11,
- &VAR1,&VAR2,
- ' ',0,
- 'I4');
-IF &SUBERR EQ 0 GOTO EXIT;
-INCLUDE DSTMEMER
-WRITE SUBLOG &SUBERR
-EXIT