MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compress a PDS using REXX

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
tattva
Beginner


Joined: 02 Feb 2005
Posts: 97
Topics: 36

PostPosted: Sat Feb 19, 2005 11:04 am    Post subject: Compress a PDS using REXX Reply with quote

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


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Sat Feb 19, 2005 12:14 pm    Post subject: Reply with quote

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.
  1. 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.
  2. 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
View user's profile Send private message Visit poster's website
nevilh
Beginner


Joined: 11 Aug 2004
Posts: 115
Topics: 0

PostPosted: Sun Feb 20, 2005 6:50 am    Post subject: Reply with quote

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


Joined: 02 Feb 2005
Posts: 97
Topics: 36

PostPosted: Wed Feb 23, 2005 5:43 am    Post subject: Reply with quote

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 !! Sad

Thanks,
------------
Tattva
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Wed Feb 23, 2005 9:44 am    Post subject: Reply with quote

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


Joined: 01 Oct 2004
Posts: 30
Topics: 0

PostPosted: Tue Mar 01, 2005 7:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group