View previous topic :: View next topic
|
Author |
Message |
Shaheen Shaik
New User
Joined: 05 May 2016 Posts: 13 Location: India
|
|
|
|
Hi
Can anyone please help me here. I am a beginner in rexx.
I have used the below code to read data from PS file to prepopulate my panel
Code: |
ADDRESS TSO "ALLOC DD(REFFIL) DA('"PREVIN"') SHR"
ADDRESS TSO "EXECIO * DISKR REFFIL (FINIS STEM REF."
ADDRESS TSO "FREE DD(REFFIL)"
PARSE VAR REF.1 VAR1 VAR2 VAR3 VAR4
MODULE = VAR1
NEWDSN = VAR2
OLDDSN = VAR3
END |
when the user enters the panel this info will be displayed and he can change it to his choice
Now I want to override the data in the PS with what ever he enters here(his choice) so that next time if the same user into panel last entered data has to be populated
Data in the PS file I gave as
xxxxx hsjdhakdh ahdjkahdf |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Please use the code tags when presenting code and data or anything else that needs a fixed pitch font or needs to retain formatting.
Does you input DATASET (not file) have only one record? If it does then you do not need a stem to store the data and you need ony tell EXECIO to read one record - this would be placed in variable REF1 (in this case).
If you always want to use the user values then on the first use simply do not take values from a dataset but get them from the users profile (VGET) before displaying the panel. They will not be there the first time so just put blanks. When the user populates them and presses enter then save them in to his profile (VPUT) ready for next time. |
|
Back to top |
|
|
Shaheen Shaik
New User
Joined: 05 May 2016 Posts: 13 Location: India
|
|
|
|
Hi Nic,
I have to write the data entered by user (VGET) to the existing PS file overriding the existing record. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Then would it not be a good idea to actually write to the data set? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
So you want to overWRITE not overRIDE? Is there just the one record? If so just write it. But that means the previous record is destroyed and, although it may not be needed NOW a rerun situation may need it so you should write the new values to a new dataset. |
|
Back to top |
|
|
Shaheen Shaik
New User
Joined: 05 May 2016 Posts: 13 Location: India
|
|
|
|
Yes Nic. I don't need the previous record in PS once I come out of panel.
Once I come out and enter again, panel should hold new value from PS.
Can you please tell me how can I move the VGET values to PS with some example.
I mean how to overwrite the existing record in REXX. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
You need to read the appropriate parts of these:
z/OS ISPF Dialog Developer's Guide and Reference
z/OS TSO/E REXX User's Guide (especially EXECIO) |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
Ok to answer our original question, when using a dataset to store values you could do this:
Code: |
ADDRESS TSO
"ALLOC DD(REFFIL) DA('"PREVIN"') SHR"
"EXECIO 1 DISKR REFFIL (FINIS)"
pull module newdsn oldddsn .
Address IspExec "Display panel(whatever)"
if rc=0 then do
queue module newdsn oldddsn
"EXECIO 1 DISKW REFFIL (FINIS)"
end
"FREE DD(REFFIL)" |
Using variables stored in the ISPF profile could be done like the following. Note that you might run into problems with APPLID, depending on how you start the program. As Nic says, you really must read those manuals.
Code: |
Address IspExec
"vget (module newdsn oldddsn) profile"
"Display panel(whatever)"
if rc=0 then "Vput (module newdsn oldddsn) profile" |
|
|
Back to top |
|
|
Shaheen Shaik
New User
Joined: 05 May 2016 Posts: 13 Location: India
|
|
|
|
Yeah it is working Willy..
Thanks Nic, Willy and Akatsukami ... |
|
Back to top |
|
|
|