Hi! i need help passing data from a cl program to a cobol program. i am a beginner programmer with some experience with these two languages. the environment is as/400. if anyone can help i'd be much appreciative.
Looks like this one has been forgotten but here is a quick hint.
Whenever you write a statement in CL, you can hit the F4 button and the screen will prompt you for the correct parameters associated with the command you have just written.
I haven't worked on As/400 for a while, and don't currently have access to one but here goes (the syntax maybe poor)..
CALL PGM((pgm-name) PARMS(PARM1 PARM2 PARM3))
where PARM1 etc have already been defined at the top of you CL program so you already know their type.
You can pass these parameters to the cobol linkage section, where they must map exactly onto each other i.e you COBOL linkage section would look something like this
note.. you can pass strings from CL like this "string value" but I wouldn't recommend this with numeric fields. Numeric values for parameters can be a pain in the arse for CL if you don't know what you are doing, avoid this problem (until you are more proficient) by passing all numerics as alphanumeric fields rather than numeric ones.
also note... you do not need to pass a length parameter in COBOL/400 as you do on mainframe cobol.
let me know if this has been helpful as I would like to know how good my memory is.
further note.. parm passing from CL is the same regardless of the whether the language the receiving program is written in is cobol or rpg.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.