View previous topic :: View next topic
|
Author |
Message |
pankaj_kulkarni111
New User
Joined: 17 Aug 2006 Posts: 13 Location: Pune
|
|
|
|
Hi there
Is there any method to delete the data in 2500 PS files in a single go. I've a REXX which does this but is there any other method?
Cheers
Pankaj |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
What are you looking for -- a program to read the list & generate the deletes, one command to kill all 2500 files, or something else? If the first, which tools do you have at your site that you could use? |
|
Back to top |
|
|
pankaj_kulkarni111
New User
Joined: 17 Aug 2006 Posts: 13 Location: Pune
|
|
|
|
Robert,
I'm looking for a program to read the list & generate the deletes in a single go.
Thanks
Pankaj |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you look into adrdssu/dfdss rather than rexx. . . |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi,
Technology won't limit you for such a task, little work around & it should be doable but what this requirement is all about - how those 2500 empty files will be used and why do you need them at first place ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Anuj,
Quote: |
those 2500 empty files |
I suspect they are not empty, but are just no longer needed. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi Dick,
May be I misunderstood this then..
Quote: |
delete the data in 2500 PS files |
once the data is been deleted, what's there in those files? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Anuj,
I suspect the goal is to remove the datasets rather than just the data.
Maybe Pankaj will clarify. . . |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
pankaj_kulkarni111 wrote: |
Is there any method to delete the data in 2500 PS files in a single go. I've a REXX which does this but is there any other method?Pankaj |
Do you want to NULL the datasets or delete the datasets ? |
|
Back to top |
|
|
pankaj_kulkarni111
New User
Joined: 17 Aug 2006 Posts: 13 Location: Pune
|
|
|
|
Well thanks to you all first for your help!
The requirement is clear to me - There are 2500 datasets (PS and NOT PDS) and one of the project team need all them to be empty because they are going to store their data in it. Now as it's client I can't go back and ask them to do on their own, by emptying the dataset manually or via a program which deletes the earlier dataset and creates the new one. We are being paid for every technical work we are doing for them .
I don't want to delete those flat files but just the data in them - hope I'm clear here. I'm also trying to get this done, if I find any method I'll post it then.
Cheers,
Pankaj |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
We are being paid for every technical work we are doing for them . |
we do not get paid to help You do Your job
Code: |
//CLEAR PROC
//IEB EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DUMMY,DCB=&DS
//SYSUT2 DD DISP=OLD,DSN=&DS
//PEND
//*
// EXEC CLEAR,DS=YOUR.DSNAME.ONE
// EXEC CLEAR,DS=YOUR.DSNAME.TWO
// EXEC CLEAR,DS=....
// EXEC CLEAR,DS=YOUR.DSNAME.TWO.THOUSAND.FIVE.HUNDRED
|
edited to correct a glitch
Robert made me notice the number of steps limit in a job
just split the job in 10 jobs with 250 steps each
wonder why the client cannot do it himself,
unless it is a deprecated project manager attitude,
if the client asks, make him pay, do it and hide any ethics
it' s from such things that good IT consultants get a bad fame |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
enrico: don't forget there's a limit on the number of steps in a single job. This will have to be done with multiple jobs (even if done with a program to open each file for output, the limit on DD statements per job would be reached). |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Thank You Robert for reminding me
post edited to make a point of it |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
I would (and have done) use a REXX that dynamically allocates the output, then drops the allocation and keeps looping. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
I suppose there is something with this that completely escapes me, but i must admit that i'm confused on multiple levels. . .
If the files exist and are to be over-written as OLD files, why do anything to them at all? (oh, yeah, the client wants to pay for this) If there is some process that retains all of the dsns but not the space and the files were not originally allocated with sufficient secondaries to handle whatever the "new" data volume, there may be lots of x37's when data is written into them.
I don't recall a system that constantly "wrote over" existing ps files rather than deleting the old (if they exist) and allocating new with proper space allocations. What is to happen other than the first re-use of these 2500 files?
If some client wants to pay for a "thing", i suppose we should not discourage them (as i've been contracting for longer than most have even been in the field ). A sweet deal would be to have a fixed-price bid for "emptying" these 2500 at a price of $5 or $10.00 (USD) per file. Pretty good $ return for an hour or 2 of work. . .
And it may be that i am just hopelessly confused. . .
d |
|
Back to top |
|
|
pankaj_kulkarni111
New User
Joined: 17 Aug 2006 Posts: 13 Location: Pune
|
|
|
|
Thanks for your help everybody, my problem is resolved by a REXX
I'll post that on Thursday, the new year day.
HAPPY NEW YEAR to you all
Cheers
Pankaj |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Dick, there were one or two times that I have had to do this, actually reset a file rather than delete and define because of some crazy special run scenario where the files were catalogued in two different catalogs on two different LPARs.
Some idiot set it up this way to do some testing, and then as the number of files grew, some poor storage guy got stuck with nullifying the files for each test cycle.
REXX worked just fine for this.
Code: |
/* REXX *** RESET DSN RATHER THAN DELETE DEFINE *
"FREE FI(SYSIN)"
"ALLOC FI(SYSIN) DUMMY"
"EXECIO * DISKR DELETES ( STEM DELS. FINIS"
DO A = 1 TO DELS.0
DSN = STRIP(SUBSTR(DELS.A,1,44))
"FREE FI(SYSUT1,SYSUT2)"
"ALLOC FI(SYSUT2) DA('"DSN"') SHR"
X = LISTDSI(SYSUT2 FILE)
SYSRECF2 = ''
DO C = 1 TO LENGTH(SYSRECFM)
SYSRECF2 = SYSRECF2 || SUBSTR(SYSRECFM,C,1) || ' '
END
SYSRECF2 = STRIP(SYSRECF2,T)
"ALLOC FI(SYSUT1) DUMMY RECFM("SYSRECF2") LRECL("SYSLRECL")"
"IEBGENER"
END
"FREE FI(SYSIN,SYSUT1,SYSUT2)" |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Expat,
Might this not lead to a flock of x37s?
Might it not be both faster and less error prone downstream to backup a complete set of the "empty" files using adrdssu/dfdss or fdr and then simply restore them as needed?
I've needed to repeatedly "start fresh" in several situations, but forcing the file to empty hasn't (yet ) been part of the plan. . . |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Unfortunately not. The files were catalog'd in two different catalogs over two different LPARS, so if they were deleted/redefined on one LPAR then it would take ages to manually update the catalog on the other LPAR to keep all in sync.
It was a diabolical setup, and had they bothered to ask a techie in the first place we could have easily shared a catalog and the DASD.
Unfortunately the outlook at some sites is rather luddite and with the same people being in the same jobs in the same company for 20+ years they know no other approach. Still, it paid the bills for a good few months |
|
Back to top |
|
|
|