I have SAS legacy code which is migrated to SAS Viya. In the code ,there are some X-commands which does not execute in SAS Viya. How do I run my x-commands in Viya Studio.
Example -
x "rm /data/sas/xplo/abc2405kjh.csv";
Hello,
You probably have NOXCMD as an option.
Check the log after submitting this:
proc options option=xcmd; run;
But for the operating system command 'rm', you can use the SAS FDELETE function instead!
The FDELETE function allows us to delete directories or files directly controlled by SAS.
Koen
Hello,
SAS has many of these functions prefixed with 'f' for dealing with external files.
BR, Koen
data _null_;
rc = filename(fref,"/data/sas/xplo/abc2405kjh.csv");
rc = fdelete(fref);
rc = filename(fref);
run;
Also see the documentation of the FDELETE Function. The other file handling functions are found right next to it.
My understanding is that if you have non-CAS eligible statements/functions, the data step will execute in SPRE (SAS Compute), which is also part of Viya.
Just as with SAS 9.4, XCMD must be enabled.
Have you seen this page in the official documentation?
That's something that a SAS Admin has to do, not an individual user.
Hello @USP2405
The SAS Viya Administrator can enable XCMD in the SAS Environment manager for SAS Studio V.
This link shows step by step how to enable XCMD in environment Manager. The method works.
https://communities.sas.com/t5/SAS-Communities-Library/SAS-Viya-3-5-SAS-Studio-and-SAS-Compute-Serve...
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!