Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Overriding PS data in rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Overriding PS data in rexx
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: 1845
Location: UK

PostPosted: Fri Mar 03, 2017 5:33 pm    Post subject:
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    Post subject:
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: 1772
Location: Bloomington, IL

PostPosted: Fri Mar 03, 2017 6:32 pm    Post subject:
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: 1845
Location: UK

PostPosted: Fri Mar 03, 2017 6:39 pm    Post subject:
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    Post subject:
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: 1845
Location: UK

PostPosted: Fri Mar 03, 2017 7:20 pm    Post subject:
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 User


Joined: 01 Sep 2015
Posts: 155
Location: Switzerland

PostPosted: Sat Mar 04, 2017 2:36 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx to create a tso command Bharath Vikraman CLIST & REXX 1 Tue Aug 08, 2017 3:32 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts Default Message in Rexx cvnlynn CLIST & REXX 9 Wed Aug 02, 2017 12:38 am
No new posts Calling CLIST through job and REXX Sahasra K CLIST & REXX 19 Tue Aug 01, 2017 10:25 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us