The only way to test if a parameter was *not* passed is to attempt to use it.
If it was not passed, you will get a MCH3601 error which you can monitor for and then do something.
If you do not monitor for the exception your program will abend.

Jeff Young
Sr. Programmer Analyst
IBM -e(logo) server Certified Systems Exper - iSeries Technical Solutions V5R2
IBM Certified Specialist- e(logo) server i5Series Technical Solutions Designer V5R3
IBM Certified Specialist- e(logo)server i5Series Technical Solutions Implementer V5R3









----- Original Message ----
From: Jesper Juul Fjeldgaard <jejfj@xxxxxxxxxx>
To: midrange-l@xxxxxxxxxxxx
Sent: Friday, December 21, 2007 8:05:42 PM
Subject: Message 10 subject: Parameters passed to a CL program

Message: 10 subject: Parameters passed to a CL program

Is there a way for a CL program to verify that it actually received a
Parameter it expects?



Hi James

You can verify the parameter as below - compare the parameter in
statement like below - pass a &TESTOK parameter as well - if the return
value is =FALSE the parameter passed is not ok.


IF COND(&PARM01 <> 'AC') THEN(DO)
CHGVAR VAR(&TESTOK) VALUE(FALSE)
GOTO CMDLBL(END)
ENDIF


.....




END ENDPGM

Yours sincerely

Jesper Juul Fjeldgaard
Vestas

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.