Learning SAS? Welcome to the exclusive online community for all SAS learners.

Running an ascii program in University originally (changed C:\ drive to myfolder already)

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 8
Accepted Solution

Running an ascii program in University originally (changed C:\ drive to myfolder already)

So I utilized this pre-written program for SAS:

/***************************************************/
/* Define the subdirectory for the FORMAT library  */
/* Output file:  C:\COMORB\FMTLIB\FORMATS.sc2      */
/***************************************************/

Libname library 'C:\COMORB\FMTLIB\';


TITLE1 'CREATE FORMAT LIBRARY OF ICD CODES AND LABELS';
  
PROC FORMAT LIB=library fmtlib;

 

And converted it to ultilize the shared folder (which I know is set up properly, as I am able to open datasets saved the the designated folder in the virtual machine) but get this read out with errors. I am brand new to SAS and am just trying to add a variable to a preexisting dataset.:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 /***************************************************/
63 /* Define the subdirectory for the FORMAT library */
64 /* Output file: /myfolders/COMORB/FMTLIB/FORMATS.sc2 */
65 /***************************************************/
66
67 Libname library '/myfolders/COMORB/FMTLIB/';
ERROR: The path /myfolders/COMORB/FMTLIB is not in the list of accessible paths when SAS is in the lockdown state.
ERROR: Error in the LIBNAME statement.
68
69
70 TITLE1 'CREATE FORMAT LIBRARY OF ICD CODES AND LABELS';
71
72 PROC FORMAT LIB=library fmtlib;
73 VALUE $RCOMFMT
ERROR: Libref LIBRARY is not assigned.
 
 
I would really appreciate any help, as I imagine it's probably just a few keystrokes regarding the directory (since it is supposed to be tested), but the other posts similar to this subject do not seem to help me (since most of them seemed to be related to using the C:\ directory). As stated the dataset I would use is in the shared folder and readily able to be opened.
 
Thank you for any help.
 
 
and
 
the program for variable creation:

Accepted Solutions
Solution
‎12-28-2016 04:16 PM
Super User
Posts: 17,724

Re: Running an ascii program in University originally (changed C:\ drive to myfolder already)

It's supposed to be 

 

/folders/myfolders/....etc

 

You're missing the first part. 

View solution in original post


All Replies
Trusted Advisor
Posts: 1,128

Re: Running an ascii program in University originally (changed C:\ drive to myfolder already)

This issue is related to the directory the libname path for which you do not have access or the path mentioned is incorrect.

 

please check the path you mentioned 'Q:\COMORB\FMTLIB\'

 

and the path displayed in log is  '/myfolders/COMORB/FMTLIB/'

 

They are not same and this could be an issue.

Thanks,
Jag
Occasional Contributor
Posts: 8

Re: Running an ascii program in University originally (changed C:\ drive to myfolder already)

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 Libname library '/myfolders/COMORB/FMTLIB/ ';
ERROR: The path /myfolders/COMORB/FMTLIB/ is not in the list of accessible paths when SAS is in the lockdown state.
ERROR: Error in the LIBNAME statement.
63
64
65 TITLE1 'CREATE FORMAT LIBRARY OF ICD CODES AND LABELS';
66
67 PROC FORMAT LIB=library fmtlib;
68 VALUE $RCOMFMT
ERROR: Libref LIBRARY is not assigned.
 
 
So this is what I am getting. I can see the /myfolders/COMORB/FMTLIB in the sidebar of SAS studio so I don't understand why it would be inaccessible. Its not referencing a Q drive/ C drive/ flash drive etc. Does it have anything to do with the name of the dataset that I am going to utilize it with (that is, are any terms actually placeholders like "library" that need alteration)? Or should the provided program just work so long as the directory naming is correct?
 
Thanks.
Solution
‎12-28-2016 04:16 PM
Super User
Posts: 17,724

Re: Running an ascii program in University originally (changed C:\ drive to myfolder already)

It's supposed to be 

 

/folders/myfolders/....etc

 

You're missing the first part. 

Occasional Contributor
Posts: 8

Re: Running an ascii program in University originally (changed C:\ drive to myfolder already)

Thanks everyone, the program ran properly.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 370 views
  • 3 likes
  • 3 in conversation