Is it possible to store permanent variables in Rexx?



IBM's Command List programming language & Restructured Extended Executor

Is it possible to store permanent variables in Rexx?

Postby deucalion0 » Sun Dec 07, 2014 5:03 pm

I am writing a Rexx program to read a dataset into a stem and edit some lines of text depending on a few conditions.

I have a problem and I am not sure about the best method to solve it. My problem is that I will run this Rexx every week and it will update the text in the dataset every week. But there is a chance that the text in that dataset could be manually changed. In that case I would like to set a variable so that when the weekly run of my Rexx starts it can check to see if the text has been manually changed during the past week. The only way I can think to do this is create another member in the dataset and write to that, for example a single line in there saying "CHANGED" or "NOTCHANGED", then read this in at the start of the Rexx, if the word CHANGED is read then the program knows that the dataset it normally works with has been manually altered.

I do not like this idea as the dataset could be deleted, moved or renamed by someone, I just do not like the fact this could cause issues.

So, is there another way that this could be done? I tried to find some way of creating permanent variables in Rexx, but could not see a way. I am not sure if persistent data is possible in Rexx, any advice is appreciated!
deucalion0
 
Posts: 55
Joined: Thu Jul 31, 2014 3:47 pm
Has thanked: 31 times
Been thanked: 0 time

Re: Is it possible to store permanent variables in Rexx?

 

Re: Is it possible to store permanent variables in Rexx?

Postby enrico-sorichetti » Sun Dec 07, 2014 6:42 pm

having some dataset manually edited is a spectre always hiding behind the doors
anybody with write access can do it

the only way is to calculate a checksum and store it as the last record

but I really doubt about the usefulness of the whole requirement

in any organization there are rules which say ...
no manual editing of ( list of dataset ) tolerated , doing so will be cause for lawful termination

easier than wasting time in programming a workaround
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Is it possible to store permanent variables in Rexx?

Postby steve-myers » Sun Dec 07, 2014 9:14 pm

Basically, I agree with Mr. Sorrichetti.

I just saw the topic title, but did not actually look at the topic until Mr. Sorrichetti responded. From the title I thought the intent was to retain the data across multiple invocations of the Rexx exec within a single TSO session.

If you are running the Rexx exec within ISPF, you might consider storing your data in the ISPF profile. While there are issues with this approach as with using a separate data set, it might be more viable than using a separate data set.
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: Is it possible to store permanent variables in Rexx?

Postby enrico-sorichetti » Sun Dec 07, 2014 10:23 pm

for what is worth here is a link

http://www.srehttp.org/apps/rexx_md5/

with snippets on how to compute MD5 in REXX
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Is it possible to store permanent variables in Rexx?

Postby deucalion0 » Thu Dec 11, 2014 4:54 pm

Thank you for your help on this. I was not sure the best way to keep global variables on mainframes.

Thanks for explaining it to me.
deucalion0
 
Posts: 55
Joined: Thu Jul 31, 2014 3:47 pm
Has thanked: 31 times
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post