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

Difference btwn uncatalog & deleting a file & COPY s


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pranta

New User


Joined: 23 Feb 2006
Posts: 16

PostPosted: Fri Mar 16, 2007 3:12 pm
Reply with quote

Hi Freiends,

I have some doubt regarding the following.Please have a look in it.

1.If we delete a file does that mean that we have uncataloged the file also?How can we access an uncataloged file..please provide sample JCLs if possible.

2.What is the difference between COPY and INC(include) a copyboob in a cobol program?In which case should we use what?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Mar 16, 2007 3:23 pm
Reply with quote

Quote:
1.If we delete a file does that mean that we have uncataloged the file also?How can we access an uncataloged file..please provide sample JCLs if possible.

No, you can delete a file without deleting the catalog entry, as you can also delete a catalog entry without deleting the file.

How do you access an uncatalog'd dataset. You need to know the volser and the unit type on which the dataset resides and specify it in the JCL, so the answer to your JCL question is site specific.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Mar 16, 2007 3:26 pm
Reply with quote

I should have added that it is normal to uncatalog the file when it is deleted, IDCAMS does this by default, but depending on which utility you use you can delete the file and retain the catalog entry.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Mar 16, 2007 3:28 pm
Reply with quote

Expat,

Quote:
you can delete a file without deleting the catalog entry


Could you please share more information on this?
Back to top
View user's profile Send private message
pranta

New User


Joined: 23 Feb 2006
Posts: 16

PostPosted: Fri Mar 16, 2007 3:29 pm
Reply with quote

Tkanks a lot for your quick response.
Back to top
View user's profile Send private message
pranta

New User


Joined: 23 Feb 2006
Posts: 16

PostPosted: Fri Mar 16, 2007 3:36 pm
Reply with quote

well few new questions has arised in my mind..
suppose i have deleted a file but retained it's catalog...shall i be able to restore back the file by cataloging it again or the contents of the file is lost? I think we can't....please correct me if i am wrong.


and please have a look in my 2nd question also...my friend faced that question in an interview.
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Fri Mar 16, 2007 3:47 pm
Reply with quote

What is the point in ( or advantage of ) deleting the file without Uncataloging it ??

Expat,
U told IDCAMS does this uncatalog by default. Can u explain a bit more on this?
Any example of a utility which ONLY DELETES the file without uncataloging??
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Mar 16, 2007 3:56 pm
Reply with quote

Quote:
suppose i have deleted a file but retained it's catalog...shall i be able to restore back the file by cataloging it again or the contents of the file is lost? I think we can't....please correct me if i am wrong.

All the catalog entry does is to point to which volume a dataset should reside on.

If it is DASD then the F1 DSCB needs to be present in the VTOC for the data to be accessible. So if you delete the F1 DSCB, i.e. delete the dataset, then to all intents and purposes the data is technically lost.

Quote:
you can delete a file without deleting the catalog entry
Could you please share more information on this?

Why would you wish to delete a dataset and leave the catalog entry intact ?
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Fri Mar 16, 2007 3:57 pm
Reply with quote

Quote:
What is the difference between COPY and INC(include) a copyboob in a cobol program?In which case should we use what?


INCLUDE is a DB2 command and COPY is a COBOL command.

The INCLUDE statement inserts application code, including declarations and statements, into a source program.

The COPY statement is a library statement that places prewritten text in a COBOL program.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Mar 16, 2007 4:29 pm
Reply with quote

Raak,

When you use DELETE 'dataset name' with IDCAMS it will automatically

Remove the F1 DSCB from the VTOC
Remove the NVR or VVR from the VVDS - If SMS manged
Remove the catalog entry from the correct catalog

The utility in question is IEHPROGM which can be used to scratch a dataset without uncatalog. The only concievable use is to delete NON SMS managed datasets from NON SMS managed volumes.

If you use it on SMS managed volumes it may not remove the NVR or VVR from the VVDS and will need you to process a DELETE NVR or VVR.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Mar 16, 2007 4:31 pm
Reply with quote

Oooooooooooops, forgot to mention,

if you use DELETE NOSCRATCH the catalog entry is untouched.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Mar 16, 2007 4:33 pm
Reply with quote

Ooooooooooops, correction to that

DELETE NOSCRATCH will delete the catalog entry and not the dataset.

That will teach me to reply to posts whilst on the phone. icon_redface.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 16, 2007 7:52 pm
Reply with quote

Hello,

This is one of the "features" that should not be used. The catalog and the physical dasd should be in sync.

When allowed, this causes problems more than 99% of the time.

Many centers will not allow this - uncataloged dasd files are automatically deleted nightly or weekly.

There is no good business reason to have an application file on dasd that is not in the catalog. If multiple copies of the file are needed, they may be copied and saved for future use (preferably to removable media and with a different dataset name).
Back to top
View user's profile Send private message
padma_prakasam

New User


Joined: 06 Oct 2005
Posts: 31

PostPosted: Fri Mar 30, 2007 2:35 pm
Reply with quote

Hi,

Few more questions on UNCATLG...

To access an UNCATLG data set, is it mandatory to give its VOLSER number. Beacuse i have tried to copy an UNCATLG dataset to another and i didn't code VOLSER. It went fine.

Thanks,
Padma
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Mar 30, 2007 2:38 pm
Reply with quote

Then I suggest that there is a catalog'd version of said dataset in existence along with the uncatalog'd version.
Back to top
View user's profile Send private message
padma_prakasam

New User


Joined: 06 Oct 2005
Posts: 31

PostPosted: Fri Mar 30, 2007 2:46 pm
Reply with quote

How does it exists like that? And if i'm not wrong dataset with disposition KEEP on normal termination will not be catalogued. So in that case too, we need VOLSER right?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Mar 30, 2007 3:00 pm
Reply with quote

Depends, SMS can override KEEP to CATLG for DASD datasets. Usually is.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 30, 2007 10:07 pm
Reply with quote

Hello,

And you may not have copied the data you intended.

It would be a good thing to find out how many copies of this dsn are on various volumes. At one site, i was asked to look into an allocation problem and found 1 entry in the system catalog and 30 others spread across their dasd (one on each volume of that group).
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top