BookmarkSubscribeRSS Feed
AlUrmcSh
Calcite | Level 5

Hi all,

I am running a syntax on SAS OnDemand for academics to code date. I am a huge newbie to SAS for context. The syntax runs but it does not generate an output file. It says it sends it to a work library but it does not do that either. The specific code is attached below. How can I get it to save properly and generate an output. Thanks!

proc datasets library=work nolist;
modify final;
attrib _all_ label='';
quit;
/*
proc datasets lib=work nolist;
save final;
quit;*/
run;
%mend;

 

2 REPLIES 2
himself
Pyrite | Level 9

Hi there! It appears that you are attempting to edit and save a dataset in SAS. Save is not a valid statement in the proc datasets procedure, and even if it weren't commented out, the save statement you're using is.

To save the altered dataset in an everlasting library, you must establish a library reference to a physical location to which you possess write access. Here's an illustration of how to achieve this:

libname mylib "/folders/myfolders/"; /* Specify your directory path */

data mylib.final; /* This will create a new dataset in the mylib library */
    set work.final;
run;

The path /folders/myfolders/ is referenced by the library mylib in this code. The data phase generates a new dataset in the mylib library called final, which is equivalent to a physical file in the /folders/myfolders/ directory. The dataset work's set statement is read.last.

 

Kindly substitute "/folders/myfolders/" with the real path to the dataset location. The changed dataset will be stored to the designated directory following the execution of this code and will remain there even after your SAS session has ended.

 

Let me know if you have any other questions!

ballardw
Super User

Please describe exactly what "output file" you are expecting.

 

Proc datasets with the MODIFY statement modifies a data set in place barring errors in code. The "output file" would be the same as the "input file".

 

 

 

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 712 views
  • 3 likes
  • 3 in conversation