CL Command definition parameter with Mixed valid values

305 pts.
Tags:
AS/400
CL
CL Commands
CL Parameters
CPYTOSTMF
Stream files
Hello, I want to create a command with a parameter same as Stream file code page in CPYTOSTMF. It shoud allow only 1 - 32657, *STMF, *PCASCII, *STDASCII. Can someone explain how could I declare parameter to have this ? Thanks Sim

Software/Hardware used:
iSeries

Answer Wiki

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

The parm definition would look something like this:<pre>
PARM KWD(STMFCODPAG) TYPE(*INT4) DFT(*STMF) +
RANGE( 1 32767 ) +
SPCVAL( +
(*STMF -1) +
(*PCASCII -2) +
(*STDASCII -3) +
) +
PROMPT(‘Stream file code page’)</pre>
The RANGE() parameter will restrict values that are entered by the user. There are also “special values” that may be entered — *STMF, *PCASCII and *STDASCII. If one of those is entered, the *CMD will translate it into the corresponding integer value.

It will be your program’s responsibility to recognize the three negative numeric values and to treat them appropriately. Since the only way that those values can appear in the parameter in your program is if they are translated from the “special values”, it will be easy to know what they mean.

You code a “special value” that way in order to handle them in numeric or date or similar types that won’t let you type them in normally.

Tom

Discuss This Question:  

 
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

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