#include <stdio.h> int remove(const char *name);
remove
deletes the MVS disk file, PDS member, or hierarchical
file specified by name
.
Under CMS, remove
deletes the CMS disk file specified by the filename
that is pointed to by name
.
remove
function returns 0 if the file is deleted. If the
file cannot be deleted or name
is invalid, - 1 is
returned.
ddn
style filenames that refer to an MVS sequential file,
remove
means to make empty. Other style filenames are
deleted and uncataloged.
VSAM data sets cannot be deleted by remove
.
CMS
If the fileid has a blank filemode, it defaults to A1
. The
string pointed to by name
should not contain wildcard values
such as *
or =
.
If the filename is in xed
style, and XEDIT is not active or the
file is not found in XEDIT, the file is searched for on disk. You
cannot remove a file found in XEDIT. However, if an xed
style
file is not found in XEDIT but is found on disk, the file is removed.
VSAM data sets cannot be deleted by remove
.
remove
can issue STOW, SCRATCH, CATALOG, OPEN, and
CLOSE SVCs. For an HFS file, remove
calls unlink
. Under
CMS, remove
performs a CMS FSERASE or invokes the callable
service library routine DMSERASE.
/* for MVS systems */ int rc; /* Delete a member of the TSO file USELESS.DATA */ rc = remove("tso:useless.data(removeme)"); /* Delete a member of the data set pointed to by */ /* ddname DATA1 */ rc = remove("ddn:data1(obs11)"); /* Empty the data set pointed to by ddname DATA1 */ rc = remove("ddn:data1"); /* for CMS systems */ int rc; rc = remove("cms:oldprog c a"); /* or */ rc = remove("ddn:data1");
rename
, rmdir
Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.