IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

LMCOPY to Temporary dataset


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rohit Sharma

New User


Joined: 28 May 2009
Posts: 5
Location: Hyderabad

PostPosted: Mon Mar 19, 2012 12:41 am
Reply with quote

Hi All ,

I need to use LMCOPY command to copy a PDS to Temporary dataset and then using IEBCOPY command i need to again copy Temporary dataset to
Same PDS . This i need to do in Rexx program . I am learning Rexx but i need to perform this copy from real to temporary and temporary to Real PDS to solve space issue urgently ?

Can any one help me with code /examples or any other direction to achieve above task ?
Thanks in advance !!!
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Mon Mar 19, 2012 12:47 am
Reply with quote

"Urgently"...

You have time to post here, but cannot be bothered to pick up a manual?

Sheesh, if you really want urgent, I can send you my PayPal account, you can transfer the going rate, eur 500 per day with a minimum of two days, and I can provide you with the code to do this.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Mar 19, 2012 1:14 am
Reply with quote

how to copy a pds has been discussed quite a few times...
why use a temporary ...
the right process is
allocate new like current ( providing if needed more space )
copy current to new
rename current to old
rename new to current

after having checked that everything is OK ... delete old

why the stupid requirement of doing it with REXX ?
nothing that IEBCOPY and IDCAMS would not do, why the LMCOPY ???
search the forums for examples

and remember Your urgency is just YOURS...
we could not care less icon_cool.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Mar 19, 2012 1:56 am
Reply with quote

why the resistance to an ISPF Option 3.3 (COPY/MOVE) ?
Back to top
View user's profile Send private message
Rohit Sharma

New User


Joined: 28 May 2009
Posts: 5
Location: Hyderabad

PostPosted: Mon Mar 19, 2012 11:35 am
Reply with quote

prino wrote:
"Urgently"...

You have time to post here, but cannot be bothered to pick up a manual?

Sheesh, if you really want urgent, I can send you my PayPal account, you can transfer the going rate, eur 500 per day with a minimum of two days, and I can provide you with the code to do this.




Thanks for finding time to comment on one word "urgently" than finding time to comment on real issue ....btw .. i mentioned urgent because i later wrote to provide code/examples if possible ..
Back to top
View user's profile Send private message
Rohit Sharma

New User


Joined: 28 May 2009
Posts: 5
Location: Hyderabad

PostPosted: Mon Mar 19, 2012 12:04 pm
Reply with quote

enrico-sorichetti wrote:
how to copy a pds has been discussed quite a few times...
why use a temporary ...
the right process is
allocate new like current ( providing if needed more space )
copy current to new
rename current to old
rename new to current

after having checked that everything is OK ... delete old

why the stupid requirement of doing it with REXX ?
nothing that IEBCOPY and IDCAMS would not do, why the LMCOPY ???
search the forums for examples

and remember Your urgency is just YOURS...
we could not care less icon_cool.gif



Thanks. It is required in Rexx because there is one dataset which is not freeing up space even after the end of program . Option like Release and
"TSO "FREE F(DNS)" have been tried but it did not work .. so the next option which could be tried ...is what i asked in this post.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Mar 19, 2012 1:23 pm
Reply with quote

yada, yada, yada,

Rohit Sharma
wrote:
Thanks. It is required in Rexx because there is one dataset which is not freeing up space even after the end of program


talk about not having an idea whatsoever about what goes on in a computer!

to find out the requirement is based on this bit of idiocy,
sorta makes you not even want to help people.
obvious why it was urgent.
the TS has their head so far up their ass that they can not breath!
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Mar 19, 2012 1:43 pm
Reply with quote

Quote:
Thanks for finding time to comment on one word "urgently" than finding time to comment on real issue


since we reply on our own time and free of charge
we are entitled to comment on the stupidity of claiming urgency
and not to reply if we do not like the TS attitude
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Mar 19, 2012 1:54 pm
Reply with quote

As has been indicated more poetically already, there is no connection between what you have described that you want to do, and a necessity to do it in rexx.

What happens when you follow enrico's suggestion? As I know it works, why do you still have a problem?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Mar 19, 2012 1:55 pm
Reply with quote

this is a very good example of:
i could not fix your brakes, so i made your horn louder
(thx McMillan)

Rohit Sharma,
why don't you explain what is going on,
and then someone could suggest a cure for your problem,
instead of a bandage for you situation.

you need to determine why the dataset is not being freed properly by the offending program
and fix it.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Mar 19, 2012 6:16 pm
Reply with quote

Use a PDSE instead of a PDS.
Back to top
View user's profile Send private message
Rohit Sharma

New User


Joined: 28 May 2009
Posts: 5
Location: Hyderabad

PostPosted: Tue Mar 20, 2012 2:09 am
Reply with quote

Pedro wrote:
Use a PDSE instead of a PDS.


Thanks Pedro. below is the code which is used for allocation of dataset
Code:
  ADDRESS TSO                                                     
  "ALLOC F(DNS) DS('"DESTPDS"') SPACE(90,50) TRACKS NEW RELEASE", 
  "REUSE DSORG(PO) DSNTYPE(LIBRARY) UNIT(SYSDA)",                 
  "RECFM(F,B) LRECL(80) "                                         
  IF RC \=0 THEN                                                   
  DO                                                               
   SAY "ALLOCATION OF TARGET DATASET '"DESTPDS"' FAILED."         
   SAY "RC FROM ALLOC: " RC                                       
   SAY "PLEASE CONTACT TECHNICAL APPLICAITON SUPPORT."             
   SAY ".........................................................."
   SAY "EXITING...."                                               
   ADDRESS DSNREXX "DISCONNECT "SUBSYS                             
   EXIT                                                           
  END                                                             
  SAY "CREATED THE TARGET DATASET..." DESTPDS*/                   
  ADDRESS TSO 'FREE F(DNS)'       



But neither Release nor Free command working to free unused space .... complete 90 tracks are allocated and when we manually free space , then finds most of the time very less number (<90) are used .
any way to resolve this issue ? because there is no error as such when program run but issue is lot of wastage of memory as unused space is not getting free .

Again thanks for understanding the problem icon_smile.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Mar 20, 2012 2:23 am
Reply with quote

ok,
neither pds's nor pds-e's are objects of which you can free unused allocated space.
that would defeat the purpose of using a library type of ds organization.

it is incredible that this thread has gone on for so long.

a TSO FREE releases the allocation of the file to the task,
it has nothing to do with the size allocation.

does this REXX Script have anything to do with db2?
YTF are you doing this:
ADDRESS DSNREXX "DISCONNECT "SUBSYS

a qsam file can have unused space released from the allocation,
as part of the disposition parameters,
but you are pissing up a rope trying to pull this crap on a PDS or PDS-E.

for the third time:
what are you doing with this REXX? what is the purpose of the PDS/PDS-E?
Back to top
View user's profile Send private message
Rohit Sharma

New User


Joined: 28 May 2009
Posts: 5
Location: Hyderabad

PostPosted: Tue Mar 20, 2012 2:37 am
Reply with quote

dbzTHEdinosauer wrote:
ok,
neither pds's nor pds-e's are objects of which you can free unused allocated space.
that would defeat the purpose of using a library type of ds organization.

it is incredible that this thread has gone on for so long.

a TSO FREE releases the allocation of the file to the task,
it has nothing to do with the size allocation.

does this REXX Script have anything to do with db2?
YTF are you doing this:
ADDRESS DSNREXX "DISCONNECT "SUBSYS

a qsam file can have unused space released from the allocation,
as part of the disposition parameters,
but you are pissing up a rope trying to pull this crap on a PDS or PDS-E.

for the third time:
what are you doing with this REXX? what is the purpos
e of the PDS/PDS-E?



Yes . This script save information in DB2 table.

this rexx creates a package through Panels and save package inofrmation in Db2 table . and this PDSE is allocated corresponding to package elements i.e. depening on type of elements there are different type of package . So this PDSE contains all those elemets which we enter to include in package .

issue is " unused space is not getting free " for above mentioned PDSE
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Mar 20, 2012 3:36 am
Reply with quote

Try a little research of your own on PDS/PDSEs and then see if you can understand what dbz has told you.

If you feel the need to free "unused" space from a PDS, or a PDSE for that matter, do it by not allocating so much space in the first place. Or do the allocation once you know the size of the data.

For a PDS you could have loads of space "wating" to be reorged to be able to be used again, but no space at all available to "rlse" (or anything else) from an extent, ie the last extent might be completely used, all the other secondaries up to there, and the primary, but the PDS can still contain a handful of members or fewer. Without the Reorg, go sing for the space.

A PDSE is better at reusing space, but not in a way which you can readily "get back" what you have allocated.

Make them "smaller", with small secondary extents. But then you have to watch them closely. Or

Live with it. OR

Do what enrico suggested much earlier in this thread, and if you are capable, do it with the space they are using at the time.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Mar 20, 2012 6:49 pm
Reply with quote

I brought up the PDSE issue, thinking it was a compress issue.

But now, I realize it is a RELEASE issue.
Code:
"ALLOC F(DNS) DS('"DESTPDS"') SPACE(90,50) TRACKS NEW RELEASE",
"REUSE DSORG(PO) DSNTYPE(LIBRARY) UNIT(SYSDA)",
"RECFM(F,B) LRECL(80) "


From TSO command reference:
Quote:
RELEASE
specifies unused space is to be deleted when the data set is closed.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Mar 20, 2012 6:59 pm
Reply with quote

so, when will the 'extra/unused' space be deleted.
when the first member is closed or the last member is closed?
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue Mar 20, 2012 8:50 pm
Reply with quote

We are talking just a few tracks here.

90 tracks is just 6 cylinders, which is small in my book.

Why not just alloacte it SPACE(1,3) CYL?

No release on a PDS/PDSE.

Then the most that can be 'wasted' is 3 cylinders.

If 45 cylinders is not enough then up the secondary allocation.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Mar 20, 2012 9:21 pm
Reply with quote

I agree that 6 cylinders is small and can be ignored. However, it should still work as documented. We should be able to discuss the concept.

The RELEASE operand of ALLOCATE is not documented well. But JCL has a similar capability with the RLSE parameter:
Code:
SPACE= ({TRK,}(primary-qty[,second-qty][,directory])[,RLSE]

RLSE is better documented and has some explanations as to why it might not release the space. See the JCL Reference.

Note: I am not recommending that you switch from rexx to JCL. I am only pointing out that the JCL equivalent is better documented and it might explain the situation better, helping you to resolve your problem.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue Mar 20, 2012 9:43 pm
Reply with quote

I think it is high time to lock this topic.

The TS is gone, not likely to return.

I think the real problem is the entire process is poorly designed, and described even worse.

The fact that an attempt to copy and re-copy data to 'free' unsused space is a waste of resources.

Our ongoing discussions on the attempt to free unused space in a pds is the most absurd yet.

This is just my opinion.

If the TS wants to contact me on the Binding of Packages using Rexx, I have a great deal of experience doing such.

My services are available on an urgent request (for a fee of course).
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top