View previous topic :: View next topic
|
Author |
Message |
kkxlnc
New User
Joined: 12 Jun 2005 Posts: 44 Location: Boston
|
|
|
|
I have never touched a rexx code earlier. So my question here is very basic. I need a small rexx code to:
1. List all PDS or PS eg: USER.TEST*.*
2. Then Read all these datasets to make sure their Reference Date on the system changes.
The reason behind this is, the datasets in our organization get deleted if they are not referenced for 5 days. So once i have this piece of code, I am going to execute it on a daily basis to make sure my files don't get deleted.
I had create 30+ files to separate out different issues and now they are all gone as the teams supposed to look at it didn't touch them. :-( |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
You realize that when (not if; they have powers and abilities far beyond those of ordinary men) the storage management team finds out what you are doing, you will be dragged from your desk by a couple of burly security guards and unceremoniously dumped on the sidewalk. There are reasons for expiration policies, among which are ensuring that clueless and/or bone-idle software engineers don't su** up all the DASD in the shop creating data sets that are never used or even referenced. |
|
Back to top |
|
|
kkxlnc
New User
Joined: 12 Jun 2005 Posts: 44 Location: Boston
|
|
|
|
Probably I didn't explain myself very clearly. My only intention is to use this for another month or so till we fix these issues in production. And I want all my analysis to stay there other teams can use it and fix stuff. Once its fixed, I am done. Then I wouldn't need those files anymore. The only issue here is the 5 day limit which is very very less for datasets to get deleted without serving their purpose. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you miss the point.
when you have a need for ds retention,
you contact your storage management people,
explain what you need and they will tell you how to create ds with the appropriate retention attributes.
get into this habit early of cooperating with sys support people,
and you will develop a reputation as someone who 'does not cause problems'
and you will find that the sys group will be supportive when you have 'special requests'.
i would not be surprised that your storage management people
have not already published something that would tell you how to do what you need,
without your asking.
upon arriving at a new shop,
the first thing i do is acquaint myself with the documentations/rules
that the sys people publish.
normally, there is little i need to do, that they have not already covered.
everybody except application support,
is there to support application support (and of course production).
piss them off and we will be able to google your name in the 'need a job ads'.
Oh by the way,
the answer to your problem is:
ask your system support people
it is very easy to see if someone is doing something as stupid as running a job that just read files and produces no output.
they will then (before inserting their boot in your ass)
ask you what are you doing, wasting cpu to read files and generate no output.
this is only one step from the most idiotic,
which is generating something to keep you from being automatically signed-off from a tso session. |
|
Back to top |
|
|
kkxlnc
New User
Joined: 12 Jun 2005 Posts: 44 Location: Boston
|
|
|
|
:-)
the place where i work is chaotic and people (support) don't respond for months..... and i have already spoken to them..... the hlq's that are retained are not accessible to normal developers..... so there is not hlq that i could use..... and only files we can create are a qualifier 'XXX.*' which is common to everyone in the organization. and i am not going to misuse, its a production issue, sorted into 30+ files which i don't want to loose.... i don't mind losing them once the issue is resolved....... |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
OK, no skin off my Sitzfleisch. I don't have access to a mainframe at the moment, but I'll write and test it tomorrow morning CDT. Just have a washbasin, soap, and towels ready for me. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Just write a loop that ALLOCates and then FREEs every dataset.
until you figure out how to write that 'complicated rexx',
just list them in 3.4 and put an I in front of the ds you want to save.
when you say deleted, are they treated as scratch - actually deleted,
or are they simply migrated?
are you sure you can not creat the ds with a class that has more than 5 days retention.
as far as the chaos is concerned,
could that not partially be the fault of people doing things like you want to do? |
|
Back to top |
|
|
kkxlnc
New User
Joined: 12 Jun 2005 Posts: 44 Location: Boston
|
|
|
|
When i say deleted, i mean completely deleted. I worked for more than 24 hours to figure out issues in 6 million records. Created one file each with a different issue, and ended up creating many datasets using sorts and ezytrieves. And I was new to this place, so wasn't aware that these get deleted if they are not referenced. I contacted storage management and asked them to restore it, they said, they are permanently gone and then i got to know about this 5 day rule. Then I asked them to give me a HLQ or a volser where i could have more days of retention, they said its only available for production datasets. I tried to dig around some documentation within the organization to understand what other rules were in place, I couldn't find much. Spoke to some production support people, and they too said they have learned to live with those limitations. I am myself surprised how all this has been designed here.
But anyways, I just wanted to avoid the hassle of doing it manually. Once my issues are fixed, i will myself delete all those files as i like to keep my HLQ clean. :-)
And surprise surprise, there is no file manager or file aid here, so have to read data and copybook by column numbers. Not sure what else is in store. |
|
Back to top |
|
|
kkxlnc
New User
Joined: 12 Jun 2005 Posts: 44 Location: Boston
|
|
|
|
Akatsukami wrote: |
OK, no skin off my Sitzfleisch. I don't have access to a mainframe at the moment, but I'll write and test it tomorrow morning CDT. Just have a washbasin, soap, and towels ready for me. |
All set. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Well, if the datasets contain production data then they should have production HLQs so get out your jobs that create these datasets, amend them to create production HLQs, give them to production support to run. Then tell whoever has to use them to fix the problem to pull their fingers out and fix the problem within the SLA parameters. Escalate it to your boss. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Akatsukami wrote: |
OK, no skin off my Sitzfleisch. I don't have access to a mainframe at the moment, but I'll write and test it tomorrow morning CDT. Just have a washbasin, soap, and towels ready for me. |
Code: |
/* Rexx */
trace o
arg hlq .
dsinfo.0 = 0
x = outtrap('dsinfo.')
"LISTCAT LEVEL('" || hlq || "')"
x = outtrap('OFF')
address ispexec
do i = 1 to dsinfo.0
parse var dsinfo.i type . dsname .
if (type="NONVSAM") then do
"LMINIT DATAID(DID) DATASET('"dsname"') ENQ(SHR)"
"LMOPEN DATAID(&DID)"
"LMCLOSE DATAID(&DID)"
"LMFREE DATAID(&DID)"
end
end
exit |
|
|
Back to top |
|
|
kkxlnc
New User
Joined: 12 Jun 2005 Posts: 44 Location: Boston
|
|
|
|
Akatsukami - wow, this works like a charm
I couldn't imagine it would be such a small piece of code in REXX to do this. How do you know all the keywords that you used here?
Thank you very much. What do i owe you? Beer or Coffee? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2546 Location: Silicon Valley
|
|
|
|
Quote: |
What do i owe you? |
Quote: |
Just have a washbasin, soap, and towels ready for me. |
I think the deal was for free room and board and valet service. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
kkxlnc wrote: |
Akatsukami - wow, this works like a charm
I couldn't imagine it would be such a small piece of code in REXX to do this. How do you know all the keywords that you used here? |
I have been in this racket for thirty-five years -- longer than many of my colleagues have been alive. This is the sort of thing that I am accustomed to -- and my team lead and users know that, and ask me to -- knock out in half an hour or so.
Without boasting (very much ), I got into my office today at 08:30 CDT, read my e-mail (including all the stuff that I couldn't deal with yesterday because I was too sick), and wrote and tested this script.
(Note that this uses TSO and ISPF services as well as Rexx. If you decide to run it in batch, you'll need to take that into account.) |
|
Back to top |
|
|
kkxlnc
New User
Joined: 12 Jun 2005 Posts: 44 Location: Boston
|
|
|
|
Akatsukami wrote: |
I have been in this racket for thirty-five years -- longer than many of my colleagues have been alive. This is the sort of thing that I am accustomed to -- and my team lead and users know that, and ask me to -- knock out in half an hour or so. |
My age is much lesser than ur experience, which means you are a living legend.
Akatsukami wrote: |
Without boasting (very much ), I got into my office today at 08:30 CDT, read my e-mail (including all the stuff that I couldn't deal with yesterday because I was too sick), and wrote and tested this script.
|
Hope your health is better now. And is there anyone in ur company to carry on your legacy after you retire.
|
|
Back to top |
|
|
|