AS400 Mid Range/Passing parms
Expert: Concise Systems/Laird Scranton - 1/16/2007
QuestionThanks
-------------------------------------------
The text above is a follow-up to ...
-----Question-----
The program I'm look at is call a program and then passing a parm.
Call PGM(*libl/css) Parm(&BDATE &TDATE)
I entere for the date parm 20060131 20061231 what am I doing wrong.
-----Answer-----
The chances are good that the program expects the dates to be in YYMMDD format. Try using:
CALL CSS PARM('013106' '123106')
- Laird
AnswerCall PGM(*libl/css) Parm(&BDATE &TDATE)
If this is a line in a CL program, &BDATE and &TDATE represent variables. The program you are calling (CSS) must be prepared to receive two variables, defined like &BDATE and &TDATE. (If &BDATE and &TDATE are character fields, the parameters in the called program must also be character variables of the same length).
In a typical example of a CL program calling an RPG program, the CL program would look like:
CSSCL: PGM PARM(&BDATE &TDATE)
DCL &BDATE *CHAR 6
DCL &TDATE *CHAR 6
CALL PGM(*LIBL/CSS) PARM &BDATE &TDATE)
END: ENDPGM
The calculation section of the RPG program would begin with
*ENTRY PLIST
PARM BDATE 6
PARM TDATE 6
You would compile the CL program and the RPG program using the CRTCLPGM and CRTRPGPGM commands, then call them:
CALL CSSCL PARM('010106' '123106')
I hope that helps!
- Laird