BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BCNAV
Quartz | Level 8

Hi all, at the end of an EG project, I need to have one dataset deleted and one copy and renamed as the one that was just deleted (for the next run).

 

I have the following in a code node as the last step of the project:

 

options noxwait;
data _null_;
	x 'del \\NCRFP4\TAF\SAS Projects Datasets\NATGapDatasets\natcumfbs1.sas7bdat'; run;
	x 'copy \\NCRFP4\TAF\SAS Projects Datasets\NATGapDatasets\natcumfbs.sas7bdat \\NCRFP4\TAF\SAS Projects Datasets\NATGapDatasets\natcumfbs1.sas7bdat';
run;

 

these steps are never executed.

 

Any insight?  Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Why do you need system commands (which are likely disabled) for such a thing:

proc datasets lib=<insertlib> nolist;
  delete natcumfbs1;
quit;

data <insertlib>.natcumfbs1;
  set <insertlib>.natcumfbs;
run;

I don't know your library so you need to put that in.

View solution in original post

3 REPLIES 3
Reeza
Super User

EG rarely supports X commands. Is X commands enabled and are you running locally where DOS is available or is EG running off a Unix Server?


Is there a specific reason you're not using the SAS functionality for this, ie PROC DATASETS can both delete and move data?

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Why do you need system commands (which are likely disabled) for such a thing:

proc datasets lib=<insertlib> nolist;
  delete natcumfbs1;
quit;

data <insertlib>.natcumfbs1;
  set <insertlib>.natcumfbs;
run;

I don't know your library so you need to put that in.

BCNAV
Quartz | Level 8
Thank you all. I am updating old code, and the X commands were there. It just never occurred to me to use proc datasets...Bah! Thanks!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 316 views
  • 0 likes
  • 3 in conversation