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

University: altering a prewritten variable creation program to working in Uni

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 8
Accepted Solution

University: altering a prewritten variable creation program to working in Uni

So after having properly imported the dataset, and created a library (as provided by the same organization that created the varibale creation program) I am trying to use the variable creation program but running into a brick wall. I assume the issue is a simple bit of confusion regarding the directories I am referencing but I cannot figure it out.  Below is the result I get:

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 LIBNAME IN1 '/folders/myfolders/sample.sas7bdat/';
ERROR: Library IN1 is not in a valid format for access method RANDOM.
ERROR: Error in the LIBNAME statement.
63 LIBNAME OUT1 '/folders/myfolders/sample.sas7bdat/';
ERROR: Library OUT1 is not in a valid format for access method RANDOM.
ERROR: Error in the LIBNAME statement.
64 LIBNAME LIBRARY '/folders/myfolders/COMORB/FMTLIB/formats.sas7bcat/';
ERROR: Library LIBRARY is not in a valid format for access method RANDOM.
ERROR: Error in the LIBNAME statement.
 
Any help in figuring out the proper formatting etc would be appreciated.  Thank you.
 
(sample is the dataset name, formats is the library name)
 

Accepted Solutions
Solution
‎12-30-2016 10:59 AM
Super User
Posts: 17,748

Re: University: altering a prewritten variable creation program to working in Uni

Libname are for folders not files. Simply think of them as folder shortcuts. 

 

Change your libname statements to reference the folder instead and your error should disappear. 

View solution in original post


All Replies
Solution
‎12-30-2016 10:59 AM
Super User
Posts: 17,748

Re: University: altering a prewritten variable creation program to working in Uni

Libname are for folders not files. Simply think of them as folder shortcuts. 

 

Change your libname statements to reference the folder instead and your error should disappear. 

Occasional Contributor
Posts: 8

Re: University: altering a prewritten variable creation program to working in Uni

Thank you, that at least got me past the initial issue. So what I hope to be the final hurdle is in how to get the porgram to actually add the variables to the dataset. When running the program it makes a content file but nothing is in it. The log is as follows:

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 LIBNAME IN1 '/folders/myfolders';
NOTE: Libref IN1 refers to the same physical library as OUT1.
NOTE: Libref IN1 was successfully assigned as follows:
Engine: V9
Physical Name: /folders/myfolders
63 LIBNAME OUT1 '/folders/myfolders/';
NOTE: Libref OUT1 refers to the same physical library as IN1.
NOTE: Libref OUT1 was successfully assigned as follows:
Engine: V9
Physical Name: /folders/myfolders
64 LIBNAME LIBRARY '/folders/myfolders/FMTLIB/';
NOTE: Library LIBRARY does not exist.
64 !
65
66 TITLE1 'CREATION AND VALIDATION OF COMORBIDITY MEASURES FOR';
67 TITLE2 'USE WITH DISCHARGE ADMINISTRATIVE DATA';
68
69 /*******************************************************************/
70 /* Macro Variables that must be set to define the characteristics */
71 /* of the input discharge data to the program */
72 /*******************************************************************/
73 * Maximum number of DXs; %LET NUMDX = 15;
74 * Input SAS file member name; %LET CORE = XXXXXX;
75
76
77 DATA OUT1.ANALYSIS;
78
79 SET IN1.&CORE (KEEP=DRG DX1-DX&NUMDX NDX);
ERROR: File IN1.XXXXXX.DATA does not exist.
80
81 DROP DRG DX1-DX&NUMDX NDX I J DXVALUE A1-A30
82 HTN HTNCX
83 CARDFLG PERIFLG CEREFLG PULMFLG DIABFLG
84 HYPOFLG RENALFLG RENFFLG LIVERFLG
85 ULCEFLG HIVFLG LEUKFLG CANCFLG ARTHFLG
86 NUTRFLG ANEMFLG ALCFLG NERVFLG HTNCXFLG HTNFLG
87 PSYFLG OBESEFLG DEPRSFLG COAGFLG
88 HTNPREG_ HTNWOCHF_ HTNWCHF_ HRENWORF_
89 HRENWRF_ HHRWOHRF_ HHRWCHF_ HHRWRF_
90 HHRWHRF_ OHTNPREG_ ;
 
 
So my first concern is that it says the library (which I did create) does not exist.
 
The second is how to get it to apply itself to the dataset. It says that IN1.XXXXX does not exist. Now I did try changing that XXXXX to sample.sas (under %LET CORE = XXXXXX).  Again I assume its a simple formatting issue, Any further help would be appreciated. Thank you again for all the help.
☑ This topic is SOLVED.

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

Discussion stats
  • 2 replies
  • 273 views
  • 2 likes
  • 2 in conversation