15 pts.
0
Q:
Parameter list is not refreshed from previous calls
I created a command with validity checker defined. The validation work fine but the parameter list is not refreshed from previous calls to the command.

I've defined a simple list for "user name " parameter in my command.

If I give 3 user names (A, B, & C) in the list, in the next call even if I enter just 1 name (say, D), the program receives users as D, B, & C.

The Validity checker and the CPP are written in CL.

Can you suggest what I may be missing?
ASKED: Jun 8 2009  6:02 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
1930 pts.
0
A:
 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0
  • AddThis Social Bookmark Button
Because the command is reusing space, you will see previous values in a list even if they are not now 'valid'.

In a simple list in a command definition, the first two bytes of the parameter passed to the CPP and to the validity checker are a binary number which tells you the number of entries in the list.

Your validity checking program must look at this value and see how many values are ACTUALLY being returned. In the example you give, this will be 3 for the first call, and 1 for the second call.

In CL, nowadays (CLLE), you can use the %BIN function to return the value in a decimal variable. Previously, you would have had to use a sort of 'lookup' on a hex string to get a single number you could understand in your CL program

Regards,

Sloopy
Last Answered: Jun 9 2009  2:45 PM GMT by Sloopy   1930 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Rohithsharma84   15 pts.  |   Jun 9 2009  7:03PM GMT

Hi Sloopy,

Thanks for looking into this.

I have been checking the length the same way you mentioned… may be I got it wrong so I’m pasting the code below. Please take a look.

This is the the parameter as defined in the command source:
PARM KWD(USER1) TYPE(*NAME) LEN(10) +
MIN(1) MAX(3) CHOICE(’Name’) PROMPT(’User +
Profile(s)’)

This is the piece from the validity checker:
CHGVAR VAR(&USER#) VALUE(%BINARY(&USER1 1 2))

Strangely enough, even if I do not enter more than 1 value in the list, it still returns the number as 3 based on my previous call.

 

TomLiotta   4880 pts.  |   Oct 22 2009  2:32AM GMT

Please supply OS version/release and cumulative PTF level.

Also, please supply (1) a little more code and (2) the command used to compile the validity checker. Other questions might follow based on those answers.

Tom

 
0