Page 1 of 2

Automatic assigning of current DSN as ISPPLIB for ISPF panel

PostPosted: Fri Sep 29, 2017 12:25 pm
by riya_kottoor
Hello..
I am using ISPF panels in one of my projects. I was hardcoding the DSN as the ISPPLIB using the statement,
"ISPEXEC LIBDEF ISPPLIB DATASET ID ('HLQ.DSN')".
It was working fine. But now I need to remove the hardcoding of the DSN such that the REXX code should automatically take the current DSN name. I tried using the ISREDIT statement,
"ISREDIT (DSN) = DSN"
and use the variable DSN instead of 'HLQ.DSN'. But it is not working. Please suggest any way to resolve this issue.

Re: Automatic assigning of current DSN as ISPPLIB for ISPF p

PostPosted: Fri Sep 29, 2017 12:52 pm
by enrico-sorichetti
...such that the REXX code should automatically take the current DSN name...


define current please !

Re: Automatic assigning of current DSN as ISPPLIB for ISPF p

PostPosted: Fri Sep 29, 2017 1:19 pm
by willy jensen
But it is not working

What error messages do you see? Hint: show the ZERRLM variable after a failed ISPF function call. Might you be missing the quotes?
I am doing something similar in one of my programs and it works for me.
You are of course it running as an edit macro since you try to use an edit macro command?

Re: Automatic assigning of current DSN as ISPPLIB for ISPF p

PostPosted: Fri Sep 29, 2017 4:09 pm
by riya_kottoor
By current DSN, I meant the dataset in which the panel description is kept. Any approaches for this need?

Re: Automatic assigning of current DSN as ISPPLIB for ISPF p

PostPosted: Fri Sep 29, 2017 4:12 pm
by riya_kottoor
willy jensen wrote:
But it is not working

You are of course it running as an edit macro since you try to use an edit macro command?

Oh..!! It is not running as an edit macro. That's why the ISREDIT command didn't work...

Re: Automatic assigning of current DSN as ISPPLIB for ISPF p

PostPosted: Fri Sep 29, 2017 4:59 pm
by willy jensen
Depending on how the program is called, the REXX 'PARSE SOURCE' command might provide the info. How is the program started? If it is started by another program, then that program could pass the info?

Re: Automatic assigning of current DSN as ISPPLIB for ISPF p

PostPosted: Fri Sep 29, 2017 5:37 pm
by enrico-sorichetti
By current DSN, I meant the dataset in which the panel description is kept


it is obvious that You need to allocate to ISPPLIB the dataset that contains the panel

again how the dataset that contains the panel becomes current ?

Re: Automatic assigning of current DSN as ISPPLIB for ISPF p

PostPosted: Wed Oct 04, 2017 11:54 am
by riya_kottoor
enrico-sorichetti wrote:
it is obvious that You need to allocate to ISPPLIB the dataset that contains the panel


I want to avoid the hard coding of DSN in the statement,
"ISPEXEC LIBDEF ISPPLIB DATASET ID('HLQ.DSN')",
such that if someone else copies the code to their PDS, they need not edit anything in the code manually. Instead, the HLQ.DSN should get replaced with the PDS name in which the other person have kept the code.

Is it possible?

Re: Automatic assigning of current DSN as ISPPLIB for ISPF p

PostPosted: Wed Oct 04, 2017 12:04 pm
by enrico-sorichetti
asking again how does the dataset that contains the panel become current ?
if You can describe the above logic, You should be able to reproduce it with some code

Re: Automatic assigning of current DSN as ISPPLIB for ISPF p

PostPosted: Wed Oct 04, 2017 9:43 pm
by Pedro
The poster's scenario is not clear. Based on the examples, I think he wants to use the data set currently being edited as the ISPPLIB data set. This approach is not good in a general case because most of the application users will not be editing the panel data set.

Starting an application is non-trivial. There are different approaches:
1. Make the installer (a person) customize the startup exec with the correct high-level qualifiers
2. Pass in the high-level qualifier as a parameter to the startup exec. For example, the installer would modify your local tool menu panel with the correct call to the startup exec,including the high level qualifier. The onus is still on the installer.
3. As stated earlier, try using PARSE SOURCE to determine the origin of the startup program and assume it is the same high level qualifier for all related data sets.
4. Just copy the application contents to system default data sets... you do not need to use LIBDEF statements.