BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
shihabur
Obsidian | Level 7

I have already selected the solution. I was making a file path name mistake. But nonetheless I have learnt from your detailed comment too. Thanks again.

shihabur
Obsidian | Level 7

This was correct. It wasn't working because of file path mistake. Now it works fine.

Reeza
Super User

That code shouldn't have worked regardless of system. 

 

Shmuel
Garnet | Level 18

What you realy need is:

 

On windows SAS system run the code:

     filename cpt '...enter path and filename';

     proc cport data= <libref>.inventory   file=cpt; run;  

 

then copy the above file to your MAC and run next code on MAC system:

     filenmae cpt ' ... path and filename on MAC ';

     proc cimport infile=cpt   lib=WORK; run;    /* or change work to any libref preffered */ 

 

You may need check syntax of PROC CPORT / PROC CIMPORT to addapt to your systems.

     

                      

shihabur
Obsidian | Level 7

There is a bunch of dataset to practice on. I made sure that they are not corrupted or broken as other people are also using it. In fact I used a completely different data set again just to make sure the problem is not with one file. But getting the same error.

ballardw
Super User

When you used this code:

data abcd.inventory;
infile "/folders/myfolders/inventory.sas7bdat";

 

both lines refer to the same system file. That was the cause of the

ERROR: File is in use, /folders/myfolders/inventory.sas7bdat.
 
While SAS will allow the the use of
data abcd.inventory;
   SET abcd.inventory;
That is a special case because SAS understands what it is doing with two references to the same data set (I strongly recommend not using that code construct until you have much experience with SAS). With the INFILE statement the file is in effect assumed to be a "foreign" or non-SAS file and actually a text file for reading.
 
You didn't show the LOG for the proc print statement. Did that execute? What was the result.
 
You don't show the log for the PROC Print. Did it actually print okay. It should have as the previous DATA step di

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 21 replies
  • 27565 views
  • 2 likes
  • 5 in conversation