BookmarkSubscribeRSS Feed
jinseokyang
Calcite | Level 5

Hello,

I have been using SAS extensively over the last 2-3 months for research

I am trying to load these files - they give you the source code

https://www.hcup-us.ahrq.gov/db/nation/sasloadprog.jsp?year=2014&db=NIS

 

Let's take one example: https://www.hcup-us.ahrq.gov/db/nation/nis/tools/pgms/SASLoad_NIS_2014_Severity.SAS

I have had no problems with copy-pasting the provided code and sticking at the very top

LIBNAME NIS '/folders/myfolders/NIS';

Then replacing the *** Data Step to load the file *** line with 
DATA nis.NIS_2014_Severity;
INFILE '/folders/myfolders/NIS/NIS_2014_Severity.ASC' LRECL = 81;

 

I loaded all of the Core files this way (the libname statement then modifying the Infile location), as well as about half of the severity files but all of a sudden my code gives me an error saying 

ERROR: User does not have appropriate authorization level for library NIS.
 
I had authorization literally 10 minutes ago. I tried rerunning old code that worked and it doesn't work anymore iether due to this error. Resetting the session didn't help, neither did trying out different folder paths and different library names. I also tried disabling Sophos as suggested before on these forums and that didn't work either.
Any tips as to what I can do? I'm not sure why something that had been working suddenly doesn't work anymoer
3 REPLIES 3
Shmuel
Garnet | Level 18

Your situation is not clear.

I have looked at code written in:

https://www.hcup-us.ahrq.gov/db/nation/nis/tools/pgms/SASLoad_NIS_2014_Severity.SAS

it conains 2 steps:

1) proc format to run and create formats in work.library catalog.

2) a data step to create a data-set using statement:

    INFILE 'NIS_2014_Severity.ASC' LRECL = 81;

 

you changed the data statement to have output to NIS library. That maybe OK.

But where is the input file? it is not a SAS data-set!

 

Do you work at home and '/folders/myfolders/...' are on your personal PC or

do you work on a class PC, then probably the NIS directory is already  assigned and

prevented from writing in (and deleting from)  by the students. 

 

Do have your own directory/library that you are authorized to read-write-delete ?

 

 

jinseokyang
Calcite | Level 5

thank you for your advice! I actually settled the problem by changing around file locations into a file location that worked.

I'm on a PC so i can make my own directory/library.

I unfortunately have a new problem though

After successfully loading the files, I ran the code

 

data nis.core_hospital;
merge
nis.Nis_2007_core
nis.Nis_2007_hospital
;
by HOSPID;
run;

^This bit works totally fine but when I run the following:

 

proc sort data = nis.core_hospital out = nis.core_hospital;
by KEY;
run;

 

I get 

ERROR: No disk space is available for the write operation. Filename =
/tmp/SAS_util000100000BD5_localhost.localdomain/ut0BD500000F.utl.
ERROR: Failure while attempting to write page 1416 of sorted run 6.
ERROR: Failure while attempting to write page 40636 to utility file 1.
ERROR: Failure encountered while creating initial set of sorted runs.
ERROR: Failure encountered during external sort.
ERROR: Sort execution failure.
 
This is weird becuase the external hard drive on my PC has 1.5 TB of space left. I tried clearing the workspace, but that didn't work. Not sure how to access the temp files because looking for the directory tmp/anything usually doesn't work? What should I do in this situation? 2014-2008 worked fine 😞
Shmuel
Garnet | Level 18

Have you previous sessions stopped unexpectedly? 

If positive it could leave a lot of garbage in your work library.

 

You need clear it, try by next code:

proc datasets lib=work;  delete _ALL_; run;

alternatively use OS commands.

Afterwords enter a new sas session and run your programs.

If you still have disk space issue you  can use same code, deleting specific temporary files

not used any more, like in:

data temp1;
 set have;
  ...
run;
data temp2;  /* or any proc creating temp2 */
 set temp1;
   ...
run;
/* no need temp1 any more - delete it */
proc datasets lib=work; delete temp1; run;

etc.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 687 views
  • 1 like
  • 2 in conversation