View previous topic :: View next topic
|
Author |
Message |
Ekta Sharma
New User
Joined: 26 Feb 2008 Posts: 35 Location: pune
|
|
|
|
I have created a ISPF panel which displays 10 PDS names. This panel requires user to enter 3 inputs: any one of the listed PDS names, a member name (member of the selected PDS) and edit/browse option. This should take the user to the given member opened in browse/edit mode.
How can I handle these inputs entered on the panel dynamically? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
First, there is no such thing as 'REXX panel'. Panels are ISPF components, and they can be displayed using any available language (including REXX).
I don't know what do you mean by "dynamically", but yes, you can process user's input by the same REXX that was used to display the panel.
O. |
|
Back to top |
|
|
Ekta Sharma
New User
Joined: 26 Feb 2008 Posts: 35 Location: pune
|
|
|
|
What I mean is that the user can select any of the PDS names listed on the panel. How the code should handle this thing? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
If you have the dataset name, you can use (for example) the EDIT ISPF Service to edit the dataset.
O. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
How are the 10 names displayed? And how does the user select one of the names?
FYI. Assign the selected name to a fixed variable name, then use that variable to edit. Something like:
Code: |
Select;
when (choice = 1) Then
edit_this = dsn1
.
.
.
"EDIT DSN("edit_this")"
|
|
|
Back to top |
|
|
Ekta Sharma
New User
Joined: 26 Feb 2008 Posts: 35 Location: pune
|
|
|
|
The 10 names are displayed as a vertical list:
1. PDS1.TEMP.SAY
2. PDS2.TEMP.QUIT
3.
.
.
10. PDS10.INPUT.TEMP
The SELECT clause would work well in this case. But the user needs to enter the member name too.
If I put the SELECT code in my REXX pgm (currently used for invoking the panel. It gives invalid statement for:
"ISPEXEC EDIT DATASET('"EDIT_THIS(MEM1)"')"
The code is as follows:
MEM1=STRIP(B)
DSN1=STRIP(A1)
CHOICE=STRIP(ZCMD)
SAY CHOICE
SELECT;
WHEN (CHOICE=1) THEN
EDIT_THIS=DSN1
OTHERWISE
SAY 'INCORRECT CHOICE'
END
"ISPEXEC EDIT DATASET('"EDIT_THIS(MEM1)"')"
END
Here, B holds the member name input by the user in the ISPF panel and A1 holds the PDS name associated with option 1 (in the list). |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
looks like the dataset name is not built correctly...
Code: |
ISPEXEC EDIT DATASET("'" !! EDIT_THIS !! "(" !! MEM1 !! ")')" |
note. !! stands for the concatenation operator, in some environments could be || |
|
Back to top |
|
|
Ekta Sharma
New User
Joined: 26 Feb 2008 Posts: 35 Location: pune
|
|
|
|
I tried it. But it's giving the following error:
Invalid member name
Member name must be 1-8 characters and enclosed in parentheses.
Current dialog statement:
EDIT DATASET(!!EDIT_THIS!!(!! MEM1 !!)) |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Have you thought about using TRACE?
O. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
I tried it. But it's giving the following error:
Invalid member name
Member name must be 1-8 characters and enclosed in parentheses.
Current dialog statement:
EDIT DATASET(!!EDIT_THIS!!(!! MEM1 !!)) |
You tried wrong...
the statement You posted does not even have a correct REXX syntax |
|
Back to top |
|
|
Ekta Sharma
New User
Joined: 26 Feb 2008 Posts: 35 Location: pune
|
|
|
|
The REXX statement that I had mentioned above is the part of error message. It's interpreted.
The statement that I had given in my code is:
"ISPEXEC EDIT DATASET("'!!EDIT_THIS!!(!! MEM1 !!)'")"
I also tried using:
"ISPEXEC EDIT DATASET("'!!EDIT_THIS!!"("!! MEM1 !!")"'")"
Same error is coming in both the case. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
The || sign should be outside the quotes, just as in Enrico's example.
O. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
are You sure You are using the right concatenation chars
as I already said in my previous posts it could be !! or || |
|
Back to top |
|
|
Ekta Sharma
New User
Joined: 26 Feb 2008 Posts: 35 Location: pune
|
|
|
|
I have tried both the symbols !! as well as ||
"ISPEXEC EDIT DATASET("'¦¦EDIT_THIS¦¦(¦¦ MEM1 ¦¦)'")" |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
before the offending statement put a
put a
after
and post the trace result ( please use the code tags ) |
|
Back to top |
|
|
Ekta Sharma
New User
Joined: 26 Feb 2008 Posts: 35 Location: pune
|
|
|
|
I used:
"ISPEXEC EDIT DATASET('"!!EDIT_THIS!!"("!!MEM1!!")')"
It gave:
20 *-* "ISPEXEC EDIT DATASET('"!!EDIT_THIS!!"("!!MEM1!!")')"
>L> "ISPEXEC EDIT DATASET('"
>L> "!!EDIT_THIS!!"
>O> "ISPEXEC EDIT DATASET('!!EDIT_THIS!!"
>L> "("
>O> "ISPEXEC EDIT DATASET('!!EDIT_THIS!!("
>L> "!!MEM1!!"
>O> "ISPEXEC EDIT DATASET('!!EDIT_THIS!!(!!MEM1!!"
>L> ")')"
>O> "ISPEXEC EDIT DATASET('!!EDIT_THIS!!(!!MEM1!!)')"
Data set not cataloged
'!!EDIT_THIS!!' was not found in catalog.
Current dialog statement:
EDIT DATASET('!!EDIT_THIS!!(!!MEM1!!)') |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
try this other way ( I usually do not recommend it because it makes things less clear )
Code: |
"ISPEXEC EDIT DATASET('"EDIT_THIS"("MEM1")')" |
but it would be wise to find out the correct concatenation char for Your
environment,
it could be due also to the 3270 emulator setup |
|
Back to top |
|
|
Ekta Sharma
New User
Joined: 26 Feb 2008 Posts: 35 Location: pune
|
|
|
|
This one worked. Thanks enrico!
Another small query:
As I told that there is a list of PDS on the panel from where the user can select any one.
This list of PDS is editable and the user can add PDS names to it as per his requirement. I have used VPUT for retaining the PDS names on the panel. But once I logoff from TSO, this list of PDS is lost. How can I retain this list (I want that the PDS names should stay on the panel until the user himself removes them)? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
use VPUT & VGET with PROFILE.
o. |
|
Back to top |
|
|
|