View previous topic :: View next topic |
Author |
Message |
tattva Beginner
Joined: 02 Feb 2005 Posts: 97 Topics: 36
|
Posted: Sat Feb 19, 2005 11:04 am Post subject: Compress a PDS using REXX |
|
|
Hi all,
Secenrio
-----------
i need to develop a utility which will compress the pDS which am currently in .
Please let me know how to proceed on this.
it wud of greate help if you cud provide the code as well.
Note the rexx utility should not take in any arg,,,
the PDS which am currently in should be compressed
TIA
-----
Tattva |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Sat Feb 19, 2005 12:14 pm Post subject: |
|
|
By 'the PDS which am currently in' (sic) I assume you mean the PDS you are editing and that you want an edit macro. This sounds like a homework assignment, and I normally would not provide code for a homework assignment, but there are two things that are not easy to look up here. - if you allocate the dataset disp=old, you will retain an exclusive ENQ even after you finish the compress. That will lock others out of the data set which you may or may not want to do.
- IEBCOPY may run authorized so you can't call it directly on some (older?) systems.
Here is one in CLIST that I've used for about 100 million years. I trust you can convert it to Rexx. Code: | ISREDIT MACRO
ISREDIT (DSNAME) = DATASET
ALLOC REU F(SYSIN) DUMMY
ALLOC REU F(SYSPRINT) DUMMY
ALLOC REU SHR F(SYSUT1) DA('&DSNAME')
ALLOC REU SHR F(SYSUT2) DA('&DSNAME')
IEBCOPY
/* ISPEXEC SELECT PGM(IEBCOPY) instead if needed |
On older systems, using the SHR allocation could lead to loss of the data set but not on recent systems (about 10 years or less). |
|
Back to top |
|
 |
nevilh Beginner
Joined: 11 Aug 2004 Posts: 115 Topics: 0
|
Posted: Sun Feb 20, 2005 6:50 am Post subject: |
|
|
Why is using Iebcopy with disp of shr no longer a rsk to data, can you point me to the documentation. I do this regularly to compress datasets but was always of the opinion there was a risk associated with this action.
Would be interested to know if my knowledge is oudated. |
|
Back to top |
|
 |
tattva Beginner
Joined: 02 Feb 2005 Posts: 97 Topics: 36
|
Posted: Wed Feb 23, 2005 5:43 am Post subject: |
|
|
No Guys.
its not for an homework assignment !!
since i dont work on REXX.. and am curious to learn ..
just thought u ppl will help me out !!
anyways !!
Thanks,
------------
Tattva |
|
Back to top |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Wed Feb 23, 2005 9:44 am Post subject: |
|
|
Quote: |
just thought u ppl will help me out !!
|
semigeezer gave you the code sample you need. What more do you want? |
|
Back to top |
|
 |
arnold57 Beginner
Joined: 01 Oct 2004 Posts: 30 Topics: 0
|
Posted: Tue Mar 01, 2005 7:04 pm Post subject: |
|
|
On older systems with DISP=SHR, two jobs could open the dataset for output and write at the same time. This could (and often did) lead to corrupted data and unusable data sets. Now, only one job at a time can open the dataset for output, even with DISP=SHR. Any other job attempting open for output will abend. This eliminates most problems, but it is not completely risk-free. Another job which opens for input and reads while you are compressing could get I/O errors or bad data. If that job later opens for output (after the compress finishes) and writes out the bad data, it could still corrupt the data set. |
|
Back to top |
|
 |
|
|