- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hey SAS-L,
The XCMD is turned off.
Is there a way to convince SAS to, when running DREA(), DNUM() etc. functions, see hidden files too?
Something like:
x 'DIR /A';
under Windows
or
filename f PIPE 'ls -a';
under Linux or UNIX systems,
but without OS level interaction.
All the best
Bart
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug
"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings
SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Best regards, Jos
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jos,
Thanks for the article but it wont help. It uses X statement. And, as I wrote, I have NOXCMD.
Bart
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug
"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings
SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
yes, I read that one too.
the FDELETE() will work with a hidden file, since it accepts a fileref and a fileref points to a particular object so this:
filename x "~/.test_hidden";
data _null_;
file x;
put "text";
run;
data _null_;
rc = fdelete('x');
run;
will work ok (I did a test on linux)
So if you have a list of hidden files you will be able to delete them, thing is to get that list with DOPEN, DREAD, DNUM, etc.
Bart
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug
"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings
SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Here's a random thought:
Does/would your system administrator permit use of some single other SAS session that allows XCMD with access to the same data storage as your sas session? Can that session be configured as the server for a sas/connect client session on your end?
Restricting access to that server might be a way for sysadmins to maintain desired authorization restrictions, while you (as an authorized user) can have your sas/connect client use the server as a proxy for the needed xcmd actions.
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set
Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets
--------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mark,
Well, it's not that easy.
I was thinking about a general solution, in particular this macro: https://github.com/SASPAC/baseplus/blob/main/baseplus.md#dirsandfiles-macro which is OS independent solution, with no XCMD needed, but lacks that "see hidden files" feature.
I was hoping that there is some SAS option which I missed that allows for such a "in depth" view. Unfortunately it looks like there is no way to do it without an OS access.
Bart
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug
"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings
SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bart,
Did you ever find a solution to this?
I'm trying to delete a folder structure cloned from GitHub, that contains .gitignore and .gitkeep files.
I'm running into the same issue.
Thanks,
Lex
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately I didn't find one 😞 😞
Unless you have XCMD enabled and will to run OS commands, SAS functions won't help you.
I also doubt that asking SAS for development will work... 😞
Bart
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug
"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings
SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Voted 👍
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug
"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings
SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
My original use-case was being able to delete a folder structure cloned from GitHub.
I was not able to do this, because the folder structure contained hidden files like .gitkeep and .gitignore.
It turns out that the GIT_DELETE_REPO function does exactly what I was looking for.
The GIT_DELETE_REPO function deletes a specified local Git repository and all of the contents inside that repository.
And actually, the function does not seem to care whether the folder is a Git folder. It will just delete any folder structure.
data _null_;
RC = GIT_DELETE_REPO('/home/lexjansen/dataset-json-sas');
put RC=;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content