DATA Step, Macro, Functions and more

Some errors when running SAS under Unix (beginner on unix SAS)

Accepted Solution Solved
Reply
Super Contributor
Posts: 318
Accepted Solution

Some errors when running SAS under Unix (beginner on unix SAS)

I was running SAS on windows pc and now want to run it under Unix.

I copied files from windows PC to the Unix machine. I got a number of errors/

 

1.When I started SAS, I got:

ERROR: Expecting page 1, got page -1 instead.
ERROR: Page validation error while reading SASUSER.PROFILE.CATALOG.
NOTE: Unable to open SASUSER.PROFILE. WORK.PROFILE will be opened instead.
NOTE: All profile changes will be lost at the end of the session.

 

2. When I tried to run sas as "sas test.sas", I got:

ERROR: File is locked, but no other information is available.  File =/HPCTMP_NOBKUP/test_04052016/test.log.  System Error Code = 38.

3. When I tried to open the test.sas file in the editor window, I got:

ERROR: File is locked, but no other information is available.  File =/HPCTMP_NOBKUP/test_04052016/test.sas.  System Error Code = 38.
ERROR: File is in use, /HPCTMP_NOBKUP/test_04052016/test.sas.

 

4. I tried copy and paste the code into the editor window, instead of trying to open the test.sas file, I still got the locked error.

 

This is my first time running sas on Unix, maybe I missed something in configuration?

 

Thanks


Accepted Solutions
Solution
‎04-08-2016 10:16 AM
Super Contributor
Posts: 318

Re: Some errors when running SAS under Unix (beginner on unix SAS)

Posted in reply to KurtBremser

Thanks all replies.

 

Someone from the high performace computing facility told me to run sas as:

 

$sas -filelocks none

 

and it solved all problem. I still do not quite get it, but this is the solution.

View solution in original post


All Replies
Super User
Super User
Posts: 7,997

Re: Some errors when running SAS under Unix (beginner on unix SAS)

Posted in reply to fengyuwuzu

Sorry, you "copied files from PC"?  In what way?  I would imagine that Unix SAS has its own installer and such like, it would certainly need different configuration to get running as paths and such like are different and catalogs will be different.  What "SAS" are you using, is it a 9.x release, SAS Univeristy Edition, EG etc.  Who brought the license, your IT group - they would be best placed to install and set it up.  The first error there could well be it trying to open a Windows style file on Unix.

Super Contributor
Posts: 318

Re: Some errors when running SAS under Unix (beginner on unix SAS)

[ Edited ]

The unix sas is also 9.4, installed on a high performance computing facility in the school.

I was using windows version SAS 9.4 on my desktop pc (win 7).

 

I transferred the data and sas files, and edited the libnames in the sas files to update the folder paths in the unix system.

I guess I need to use "-flielocks continue" somewhere, but not sure

Super User
Super User
Posts: 7,079

Re: Some errors when running SAS under Unix (beginner on unix SAS)

[ Edited ]
Posted in reply to fengyuwuzu

Looks like you tried to copy your SASUSER.PROFILE catalog from your PC to Unix.  Don't do that.  Just delete the catalogs in your SASUSER library and SAS will create new valid ones the first time you start it.

 

In fact you cannot directly copy any catalog (*.sas7bcat)  files between different versions of SAS.  You CAN copy the SAS datasets (*.sas7bdat) but you might need to convert them to get the best performance.

 

If you want to transfer catalogs (like format catalogs) then you can use PROC CPORT to export on the old machine and PROC CIMPORT to import on the new machine.  

 

For format catalogs you can also use PROC FORMAT to create a SAS dataset with the format definition. You can then copy the dataset and use PROC FORMAT to use it to create a new format catalog.  Or you just re-run the SAS program that created the format catalog on the new machine.

Super Contributor
Posts: 318

Re: Some errors when running SAS under Unix (beginner on unix SAS)

I deleted the profile.sas7bcat and regatry.sas7bitm in the sasuser.v94 directory, and started sas again.

Then in sas I created a small program and tried to save it, still got the lock error.

Then I used vi to create a small sas file, just read in 2 data lines, and saved as .sas file. I tried to open it in SAS, but got the locked error again. This .sas file is a fresh one created in Unix, not a windows version.

I also tried to start SAS as "$ sas -filelocks continue" but it does not make difference
Super User
Posts: 7,866

Re: Some errors when running SAS under Unix (beginner on unix SAS)

Posted in reply to fengyuwuzu

How do you log on to the UNIX system?

 

Once you are logged on, change to the directory where your .sas file is located and do a ls -l filename

If the file exists and should be accessible to you (check user/group and permissions), try vi filename

(as the text editor vi exists on all UNIX systems)

If you still get messages indicating the file is locked, try fuser filename

This is a command that shows process numbers that have an open filehandle on filename

 

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Solution
‎04-08-2016 10:16 AM
Super Contributor
Posts: 318

Re: Some errors when running SAS under Unix (beginner on unix SAS)

Posted in reply to KurtBremser

Thanks all replies.

 

Someone from the high performace computing facility told me to run sas as:

 

$sas -filelocks none

 

and it solved all problem. I still do not quite get it, but this is the solution.

Super Contributor
Posts: 318

Re: Some errors when running SAS under Unix (beginner on unix SAS)

Posted in reply to KurtBremser

Thank you, Kurt

I am the only person using the file. Not sure why I got the error.

SAS -filelocks continue did not solve the problem, but sas -filelocks none did.

☑ This topic is solved.

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

Discussion stats
  • 7 replies
  • 759 views
  • 0 likes
  • 4 in conversation