Module RecycleBinService
Macros to retrieve and permanently delete items in the recycle bin.
Since: 2.1
Macro Summary |
external
LSAF | %lsaf_deleterbitemsbyquery(lsaf_location=, lsaf_name=, lsaf_deletedby=, lsaf_from=, lsaf_to=, lsaf_includesubfolders=, sas_result_dsname=work.lsafdeleterbitemsbyquery);
Permanently deletes items from the recycle bin that match the specified criteria. The paths ...
|
external
LSAF | %lsaf_deleterecyclebinitems(sas_dsname=, sas_result_dsname=work.lsafdeleterecyclebinitems);
Permanently deletes items from the SAS Life Science Analytics Framework recycle bin using a ...
|
external
LSAF | %lsaf_getrecyclebinitems(lsaf_location=, lsaf_name=, lsaf_deletedby=, lsaf_from=, lsaf_to=, lsaf_includesubfolders=, sas_dsname=work.lsafgetrecyclebinitems, lsaf_printLimitReachedWarning=1);
Gets the metadata for the items in the SAS Life Science Analytics Framework recycle bin that ...
|
%lsaf_deleterbitemsbyquery(lsaf_location=, lsaf_name=, lsaf_deletedby=, lsaf_from=, lsaf_to=, lsaf_includesubfolders=, sas_result_dsname=work.lsafdeleterbitemsbyquery);
[ Exposure:
external
]
- Permanently deletes items from the recycle bin that match the specified criteria. The paths
of the items that were permanently deleted are returned in a SAS data set.
To delete items put in the recycle bin by other users, you must have the Permanently Delete
Items privilege.
Syntax:
%LSAF_DELETERBITEMSBYQUERY(LSAF_LOCATION=lsaf-location <, LSAF_NAME=lsaf-name,
LSAF_DELETEDBY=lsaf-deletedby, LSAF_FROM=lsaf-from-date, LSAF_TO=lsaf-to-date,
LSAF_INCLUDESUBFOLDERS=lsaf-includeSubfolders, SAS_RESULT_DSNAME=SAS-data-set);
-
History:
- 2019-08-29
- original coding.
- 2019-11-01
- update to handle a blank SAS output file.
-
-
Expected Macro Variables:
-
_lsafMsg_
-
The return message.
-
_lsafRC_
-
The return code.
-
Parameters:
-
lsaf_location
-
- Optional - The location of the container in the repository that is the
parent of the deleted items. Items from child paths are also returned.
-
lsaf_name
-
- Optional - The name of the item to return by the search. If set to
* (such as lsaf_name=*) or is omitted, items of any name are returned.
Wildcards can be used. For example, lsaf_name=*.sas returns all of the items with
a .sas extension.
-
lsaf_deletedby
-
- Optional - The identifier of the user who deleted the item.
If omitted, set to blank, or * (such as lsaf_deletedby=*), all items that the
current user has the privilege to retrieve, regardless of who deleted the items,
are returned. If the current user lacks the privileges, only current user items
are returned.
-
lsaf_from
-
- Optional - The beginning of the date range for items that were deleted
within a specific time period. Values must be one of the formats described below.
Date values in formats other than those described below result in an execution
failure.
- SAS datetime18. format (such as 02NOV2013:09:33:22) - an offset of zero hours
from GMT is used.
- SAS E8601DZ25. format (such as 2013-11-02T09:33:22-04:00).
-
lsaf_to
-
- Optional - The end of the date range for items that were deleted within a
specific time period. Values must be one of the formats described below. Date
values in formats other than those described below result in an execution
failure.
- SAS datetime18. format (such as 02NOV2013:09:33:22) - an offset of zero hours
from GMT is used.
- SAS E8601DZ25. format (such as 2013-11-02T09:33:22-04:00).
-
lsaf_includesubfolders
-
- Optional - Indicates whether the search includes containers
within the specified location. Valid values:
- 0: Exclude subfolders.
- 1 (Default): Include subfolders.
-
sas_result_dsname
-
- Optional - The name of the output SAS data set to contain the
deleted paths, specified as libref.dataset. The default is
WORK.LSAFDELETERBITEMSBYQUERY. The data set contains a row for each deleted path
and columns with the following names. The data set is sorted by path.
- name: The name of the item.
- path: The path of the item.
-
File: lsaf_deleterbitemsbyquery.sas
-
First available in version: 2.2
%lsaf_deleterecyclebinitems(sas_dsname=, sas_result_dsname=work.lsafdeleterecyclebinitems);
[ Exposure:
external
]
- Permanently deletes items from the SAS Life Science Analytics Framework recycle bin using a
data set as input. Returns a SAS data set that contains the paths for the items that were
permanently deleted from the SAS Life Science Analytics Framework recycle bin.
The items listed in the input data set are permanently removed from the recycle bin,
provided that the user has the Permanently Delete Items role privilege at the organization
context. No error message is provided for items that cannot be permanently deleted.
A path that is created and deleted multiple times from the repository appear multiple times
in the recycle bin. Therefore, the items must be referenced by their unique identifier. The
identifier can be retrieved using the lsaf_getrecyclebinitems macro.
The output data set contains one row for each location that is permanently deleted from
the recycle bin. If multiple items with the same path are deleted, the path is listed only
once. The locations for each item that are deleted from a container (such as a folder)
will be listed separately in the output data set.
Syntax:
%LSAF_DELETERECYCLEBINITEMS(SAS_DSNAME=SAS-data-set, SAS_RESULT_DSNAME=SAS-data-set);
Example Code:
Delete everything a specific user deleted.
* start code example;
%lsaf_getrecyclebinitems(sas_dsname=lsafGetRBItems);
data deleterbitems;
set lsafGetRBItems;
if (deletedBy="myuserid");
run;
%lsaf_deleterecyclebinitems(sas_dsname=deleterbitems, sas_result_dsname=deletedpaths);
* end code example;
-
History:
- 2013-03-27
- initial code
- 2016-08-26
- rebrand as LSAF
- 2019-02-20
- update to 2.1 and rename from lsaf_deleterbitems to
lsaf_deleterecyclebinitems
- 2019-11-01
- update to handle a blank SAS output file.
-
-
Expected Macro Variables:
-
_lsafMsg_
-
The return message.
-
_lsafRC_
-
The return code.
-
Parameters:
-
sas_dsname
-
- Required - The name of a SAS data set that contains the identifiers for the
items to delete from the recycle bin. The data set must contain at least the
variables listed below. Additional variables are ignored.
- identifier: The unique identifier for the item.
-
sas_result_dsname
-
- Optional - The name of the output SAS data set to contain the
deleted paths, specified as libref.dataset. The default is
WORK.LSAFDELETERECYCLEBINITEMS. The data set contains a row for each deleted path
and columns with the following names. The data set is sorted by path.
- name: The name of the item.
- path: The path of the item.
-
File: lsaf_deleterecyclebinitems.sas
-
First available in version: 1.4
%lsaf_getrecyclebinitems(lsaf_location=, lsaf_name=, lsaf_deletedby=, lsaf_from=, lsaf_to=, lsaf_includesubfolders=, sas_dsname=work.lsafgetrecyclebinitems, lsaf_printLimitReachedWarning=1);
[ Exposure:
external
]
- Gets the metadata for the items in the SAS Life Science Analytics Framework recycle bin that
match the given search criteria. The metadata is stored in a SAS data set.
The number of items that can be returned from a query is limited. The macro
variable _lsafRBSearchLimitReached_ returns a 0 if this maximum limit is not reached and a 1
if the limit is reached. If the limit is reached, there might be items in the recycle bin
that meet the given criteria. A more refined search is needed to retrieve those records.
Users must have the Permanently Delete Items or Restore Items Deleted by Others role
privilege at the specified location to retrieve items put in the recycle bin by other users.
Syntax:
%LSAF_GETRECYCLEBINITEMS(LSAF_LOCATION=lsaf-location <, LSAF_NAME=lsaf-name,
LSAF_DELETEDBY=lsaf-deletedby, LSAF_FROM=lsaf-from-date, LSAF_TO=lsaf-to-date,
LSAF_INCLUDESUBFOLDERS=lsaf-includeSubfolders, SAS_DSNAME=SAS-data-set,
LSAF_PRINTLIMITREACHEDWARNING = lsaf-print-limit-reached-warning>);
-
History:
- 2017-01-24
- original coding.
- 2019-02-15
- update to 2.1
- 2019-02-20
- renamed from lsaf_getrbitemsbyquery to lsaf_getrecyclebinitems
- 2019-09-10
- added includesubfolders parameter
- 2019-11-01
- update to handle a blank SAS output file.
-
-
Expected Macro Variables:
-
_lsafMsg_
-
The return message.
-
_lsafRBSearchLimitReached_
-
The search limit reached flag.
-
_lsafRC_
-
The return code.
-
Parameters:
-
lsaf_location
-
- Optional - The location of the container in the repository that is the
parent of the deleted items. Items from child paths are also returned.
-
lsaf_name
-
- Optional - The name of the item to return by the search. If set to
* (such as lsaf_name=*) or is omitted, items of any name are returned.
Wildcard notation can be used. For example, lsaf_name=*.sas returns all of the
items with a .sas extension.
-
lsaf_deletedby
-
- Optional - The ID of the user who deleted the item.
If omitted, set to blank, or * (such as lsaf_deletedby=*), all items that the
current user has the privilege to retrieve, regardless of who deleted the items,
are returned. If the current user lacks the privileges, only current user items
are returned.
-
lsaf_from
-
- Optional - The beginning of the date range for items deleted within a
specific time period. Values must be one of the formats described below. Date
values in formats other than the two described below result in an execution
failure.
- SAS datetime18. format (such as 02NOV2013:09:33:22) - an offset of zero hours
from GMT is used.
- SAS E8601DZ25. format (such as 2013-11-02T09:33:22-04:00).
-
lsaf_to
-
- Optional - The end of the date range for items deleted within a
specific time period. Values must be one of the formats described below. Date
values in formats other than the two described below result in an execution
failure.
- SAS datetime18. format (such as 02NOV2013:09:33:22) - an offset of zero hours
from GMT is used.
- SAS E8601DZ25. format (such 2013-11-02T09:33:22-04:00).
-
lsaf_includesubfolders
-
- Optional - Indicates whether recycle bin searches containers
beyond the specified location. Valid values:
- 0: Exclude subfolders.
- 1 (Default): Include subfolders.
-
sas_dsname
-
- Optional - The name of the output SAS data set to contain the metadata
for the items, specified as libref.dataset. The default value is
WORK.LSAFGETRECYCLEBINITEMS. The data set contains a row for each item in the
list and columns with the following names. The data set is be sorted by path.
- name: The name of the item.
- path: The path of the item.
- type: Type of the item (such as folder or data set)
- identifier: The unique identifier of the item.
- size: The size (in bytes) of the item. The size is 0 for a container.
- deletedBy: The user ID that deleted the item.
- deletedOn: The full date and time on which the item was deleted, represented as
a String.
- dateDeleted: The date on which the item was deleted, specified as a SAS
Datetime format.
- lastModifiedBy: The user ID that last modified the item.
- lastModifiedOn: The date on which the item was last modified, represented as a
String.
- dateLastModified: The date on which the item was last modified, represented as
a SAS Datetime format.
-
lsaf_printLimitReachedWarning
-
- Optional - Indicates whether to print the message
about the server query limit being reached as a WARNING or a NOTE. Valid values:
- 0: NOTE.
- 1 (Default): WARNING.
This option applies only when the _lsafRBSearchLimitReached_ macro is 1.
-
File: lsaf_getrecyclebinitems.sas
-
First available in version: 1.5