IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Overriding PS data in rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Shaheen Shaik

New User


Joined: 05 May 2016
Posts: 13
Location: India

PostPosted: Fri Mar 03, 2017 5:08 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Mar 03, 2017 5:33 pm
Reply with quote

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
View user's profile Send private message
Shaheen Shaik

New User


Joined: 05 May 2016
Posts: 13
Location: India

PostPosted: Fri Mar 03, 2017 5:59 pm
Reply with quote

Hi Nic,

I have to write the data entered by user (VGET) to the existing PS file overriding the existing record.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Mar 03, 2017 6:32 pm
Reply with quote

Then would it not be a good idea to actually write to the data set?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Mar 03, 2017 6:39 pm
Reply with quote

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
View user's profile Send private message
Shaheen Shaik

New User


Joined: 05 May 2016
Posts: 13
Location: India

PostPosted: Fri Mar 03, 2017 7:07 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Mar 03, 2017 7:20 pm
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Sat Mar 04, 2017 2:36 pm
Reply with quote

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
View user's profile Send private message
Shaheen Shaik

New User


Joined: 05 May 2016
Posts: 13
Location: India

PostPosted: Mon Mar 06, 2017 12:13 pm
Reply with quote

Yeah it is working Willy..
Thanks Nic, Willy and Akatsukami ... icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top