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
 

 

List PDS and PS through rexx and reference it ??

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
kkxlnc

New User


Joined: 12 Jun 2005
Posts: 44
Location: Boston

PostPosted: Wed Jun 20, 2012 3:22 am    Post subject: List PDS and PS through rexx and reference it ??
Reply with quote

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

Akatsukami

Global Moderator


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

PostPosted: Wed Jun 20, 2012 3:31 am    Post subject:
Reply with quote

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

New User


Joined: 12 Jun 2005
Posts: 44
Location: Boston

PostPosted: Wed Jun 20, 2012 3:46 am    Post subject:
Reply with quote

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 20, 2012 4:11 am    Post subject:
Reply with quote

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

New User


Joined: 12 Jun 2005
Posts: 44
Location: Boston

PostPosted: Wed Jun 20, 2012 4:22 am    Post subject:
Reply with quote

:-)

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

Global Moderator


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

PostPosted: Wed Jun 20, 2012 4:33 am    Post subject:
Reply with quote

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 20, 2012 4:49 am    Post subject:
Reply with quote

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

New User


Joined: 12 Jun 2005
Posts: 44
Location: Boston

PostPosted: Wed Jun 20, 2012 6:28 am    Post subject:
Reply with quote

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

New User


Joined: 12 Jun 2005
Posts: 44
Location: Boston

PostPosted: Wed Jun 20, 2012 6:31 am    Post subject:
Reply with quote

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. icon_wink.gif icon_smile.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Wed Jun 20, 2012 12:24 pm    Post subject:
Reply with quote

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

Global Moderator


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

PostPosted: Wed Jun 20, 2012 8:07 pm    Post subject:
Reply with quote

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

New User


Joined: 12 Jun 2005
Posts: 44
Location: Boston

PostPosted: Thu Jun 21, 2012 2:31 am    Post subject:
Reply with quote

Akatsukami - wow, this works like a charm icon_exclaim.gif icon_exclaim.gif icon_exclaim.gif
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
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Thu Jun 21, 2012 4:49 am    Post subject: Reply to: List PDS and PS through rexx and reference it ??
Reply with quote

Quote:
What do i owe you?


Quote:
Just have a washbasin, soap, and towels ready for me.


Quote:
All set.


I think the deal was for free room and board and valet service.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Thu Jun 21, 2012 5:56 am    Post subject:
Reply with quote

kkxlnc wrote:
Akatsukami - wow, this works like a charm icon_exclaim.gif icon_exclaim.gif icon_exclaim.gif
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 icon_smile.gif ), 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
View user's profile Send private message
kkxlnc

New User


Joined: 12 Jun 2005
Posts: 44
Location: Boston

PostPosted: Fri Jun 22, 2012 12:10 am    Post subject:
Reply with quote

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 icon_smile.gif ), 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.
icon_surprised.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
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


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