View previous topic :: View next topic
|
Author |
Message |
biswadeepghosh
New User
Joined: 03 Jan 2008 Posts: 14 Location: Pune
|
|
|
|
I'm changing a CLIST program which calls ISPF panels to get data and then calls a REXX program passing the same data which is processed and displayed.
Whilst calling the REXX pgm i pass the variables like
PGM1 &VAR1 &VAR2 &VAR3.
Var1/var2/Var3 are populated in the ISPF panel called before PGM1 is called.
Now the problem i'm facing is if VAR2 is not populated, the Pgm1 picks up the data of Var 3 as of VAr 2 in the REXX pgm .
Can someone suggest ?
Can i assign default values to Variable taken as input from the ISPF screen ? if yes how ? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
VPUT VGET |
|
Back to top |
|
|
akhi007
New User
Joined: 30 Jan 2006 Posts: 35 Location: Richmond
|
|
|
|
Hi,
Verify whether values is getting populated into VAR1 VAR2 and VAR3 variables. Suppose if the value of VAR2 is spaces from the panel, then rexx will replace the value of VAR2 by VAR3.
For e.g, You are passing the following values,
VAR1 = "ABC"
VAR2 = ""
VAR3 = 123
CALL PGM &VAR1 &VAR2 &VAR3
PGM:
/*rexx */
parse arg v1 v2 v3
Say v1
Say v2
Say v3
here, result will be as follows
ABC
123
...
Inorder to avoid this, put a check for spaces before calling the rexx routine. If it is spaces, then pass some dummy value. This will solve the problem. |
|
Back to top |
|
|
biswadeepghosh
New User
Joined: 03 Jan 2008 Posts: 14 Location: Pune
|
|
|
|
oops ! sorry but how to check for spaces in CLIST ... i'm really weak in tat . |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
That is the reason I suggested using VPUT / VGET. The variables keep the values assigned in the panel, so no need to worry if one or more are blank. |
|
Back to top |
|
|
biswadeepghosh
New User
Joined: 03 Jan 2008 Posts: 14 Location: Pune
|
|
|
|
Sorry not getting it
In the CLIST i am defining
ISPEXEC VGET (BG11,BG12,BG13,BG14,BG15)
The feilds which need to be populated in the ISPF panel
BG11 BG12 BG13 BG14 BG15 ( anyone could be blank)
Now whilst calling the REXX pgm these variables dont seem to have any data. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
No, they wouldn't have any value until you VPUT them first.
The variables in the CLIST which displays the panel are populated with whatever is entered into the panel, so VPUT them (usually use PROFILE) and in the REXX VGET them. |
|
Back to top |
|
|
biswadeepghosh
New User
Joined: 03 Jan 2008 Posts: 14 Location: Pune
|
|
|
|
Thanks a lot .... it worked ! |
|
Back to top |
|
|
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 194 Location: India
|
|
|
|
may be delay reply. but instead of checking values in rexx/clist why can't you check in panel definition code it self. |
|
Back to top |
|
|
biswadeepghosh
New User
Joined: 03 Jan 2008 Posts: 14 Location: Pune
|
|
|
|
are you saying to pass a default value if the feild is left blank ?.. im not sure of VER has this option ? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Quote: |
may be delay reply. but instead of checking values in rexx/clist why can't you check in panel definition code it self. |
Why check them in the panel, if a null value is assigned then a null value is assigned.
As the variables are used. possibly checked, in the REXX / CLIST anyway, why check them in the panel as well ? |
|
Back to top |
|
|
|