Write and run SAS programs in your web browser

File properties not read when using imported TLSB programs

Reply
Occasional Contributor
Posts: 7

File properties not read when using imported TLSB programs

Hello,

I am using SAS Studio 9.2 I have uploaded the practice problems that appear in The Little SAS Book (TLSB).

 

* Section 3.11*/
/* Program */
* Change all 9s to missing values;
DATA songs;
INFILE 'c:\MyRawData\KBRK.dat';
INPUT City $ 1-15 Age wj kt tr filp ttr;
ARRAY song (5) wj kt tr filp ttr;
DO i = 1 TO 5;
IF song(i) = 9 THEN song(i) = .;
END;
RUN;
PROC PRINT DATA = songs;
TITLE 'KBRK Song Survey';
RUN;

 

In this instance, I am referencing problem 3-11 (above) though I’ve encountered it with every problem I’ve sampled jus to make sure.

 

The ‘infile statement’ directs me to the c: drive.  When I click on the file’s ‘Properties’ and cut and paste the exact location of the file for the infile statement, a second infile statement appears along with five errors in the log (condensed below) and two expected warnings.

ERROR 23-2: Invalid option name C, MyRawDATA, KBRK, Song, and Survey)

When I run the problem as it appears, I get a single error message

ERROR: Physical file does not exist, /pbr/biconfig/940/Lev1/SASApp/c:\MyRawData\KBRK.dat.’

 I am not including the six notes here but have attached the logs of both programs. Thank you in advance for your help.

Grand Advisor
Posts: 10,196

Re: File properties not read when using imported TLSB programs

The "Physical File does not exist" message tells you where SAS looked for your data. The mixture of /  and \ in that message tells me that your SAS is likely a server and can not see your harddrive. You have to make sure you read (and write) to locations the server sees which may involve working with either your ID or SAS admin to set permissions and identify your hard drive to the SAS session as a source. Note that the paths will likey look different.

 

 

Occasional Contributor
Posts: 7

Re: File properties not read when using imported TLSB programs

Thank you so very much. Here is a "virtual" frozen Reese's Cup  (one of life's little luxuries) for your help.

Sent from my Verizon Wireless 4G LTE Droid
Ask a Question
Discussion stats
  • 2 replies
  • 259 views
  • 0 likes
  • 2 in conversation