Need to make a parameter required !

65 pts.
Tags:
CL
CMD
parameter
required
I want to code a *cmd with four parameters. 1. I want all of them to be required ( i.e. pressing enter without typing anything should issue a error message "Parameter BLABLA required") 2. I want to check at a *cmd level , not at the *pgm level behind the command if the entered parameter contains a string. (i.e. if the parameter is a mail, and it is , i want to be sure that it is like %@myworkspace.com or other ) I repeat i want to do this at the *cmd level not at the *pgm level because i've already done that! i can write a verification program also , but is there a way to do this from the *cmd source ?

Answer Wiki

Thanks. We'll let you know when a new response is added.

1. MIN(1) will force an error if nothing is entered

=====================================================

<i>2. I want to check at a *cmd level , not at the *pgm level behind the command if the entered parameter contains a string. </i>

That, unfortunately, doesn’t make a lot of sense. If the parm type is *CHAR and the parm requires MIN(1) as noted above, then it is automatically a “string” no matter what is typed as long as it isn’t left blank.

<i>(i.e. if the parameter is a mail, and it is , i want to be sure that it is like %@myworkspace.com or other )</i>

But if the request is about how to enforce some <i>arbitrary pattern</i> on the characters, then there is no way the *CMD can do that. A validity-checker program is required if you need to validate the <i>content</i> of the parm value. And that’s probably a good idea since it would make command definitions much more complex to do it in *CMD language. Why create a new *CMD language construct when it’s already possible in all of the allowed VCP languages?

Tom

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • joederoche
    Lordache, According to the IBM Information center, if you want to do any validity checking on any of the parameters that are entered on a command, and they can not be entered as a value list, you would need to create a validity checking program and then attach that program to the command on the VLDCKR parameter on the CRTCMD command when the command is created/compiled. Here is the link: http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp
    55 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following