AS400 Mid Range/Passing parms

Advertisement


Question
Thanks
-------------------------------------------
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

Answer
Call 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

AS400 Mid Range

All Answers


Answers by Expert:


Ask Experts

Volunteer


Concise Systems/Laird Scranton

Expertise

General AS/400, RPG/400, SDA and CL programming questions. AS/400 performance tuning.

Experience


Past/Present clients
CB Sportswear
Coca-Cola of New York
Encore Paper Company
Golub Corporation
HBO Home Video
Imperial Pools
Kaiser Permanente of NE New York
Mallinckrodt Medical
Marigold Foods
Manpower & Associates
National Datacomputers
New York State Easter Seals Society
New York State Food Merchants Association
Pepsi-Cola Allied Bottlers
Petricca Construction
Taconic Telephone Corporation
TOMRA Recycling
Unistress Corporation

©2012 About.com, a part of The New York Times Company. All rights reserved.