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

Setting up Statdat and library

Reply
Occasional Contributor
Posts: 19

Setting up Statdat and library

Hi,

I recently took up the course 'Introduction to Statistical Analysis' and I am trying to set up 'Statadata' and library in the mentioned files but when I try to access run code for test scores I am getting an error 'statdata not found'.


I am running the following code:


libname statdata "myfolders/ESCTAT0";

libname library "myfolders/ESCTAT0";

I also tried:

libname statdata "folders/myfolders/ESCTAT0";

libname library "folders/myfolders/ESCTAT0";

I strictly sticking to the information given while taking the classes.

Kindly help me out.

Super User
Posts: 11,343

Re: Setting up Statdat and library

Posted in reply to varun1220

Have you tried:

libname statdata "/folders/myfolders/ESCTAT0";

And ensured that the data files are in that folder?

Occasional Contributor
Posts: 19

Re: Setting up Statdat and library

Yes. I have tried that too. The code did get executed without any errors but when I checked the folder ESCTAT0 there was nothing created there.

Occasional Contributor
Posts: 19

Re: Setting up Statdat and library

I did try that. The code I ran was

libname statdata "/folders/myfolders/ESCTAT0";

libname library "/folders/myfolders/ESCTAT0";

This code was executed successfully without any errors.

After this assuming that the libraries are installed I tried running the following code:

proc print data= statdata.testscores (obs=10)

title 'Test Scores'

run;

But for this code I get the following error.

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

57 

58 proc print data= statdata.testscores (obs=10)

59 title 'Test Scores'

  _____

  22

  76

ERROR 22-322: Syntax error, expecting one of the following: ;, BLANKLINE, CONTENTS, DATA, DOUBLE, GRANDTOTAL_LABEL, GRANDTOT_LABEL,

  GRAND_LABEL, GTOTAL_LABEL, GTOT_LABEL, HEADING, LABEL, N, NOOBS, NOSUMLABEL, OBS, ROUND, ROWS, SPLIT, STYLE,

  SUMLABEL, UNIFORM, WIDTH. 

ERROR 76-322: Syntax error, statement will be ignored.

60 run;

61 

62 

63 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

75 

Since I am totally new to SAS I am not able to diagnose the problem.

SAS Super FREQ
Posts: 8,868

Re: Setting up Statdat and library

Posted in reply to varun1220

Hi, there:

  Did you copy and paste code or did you type code? Every SAS statement ends with a semi-colon (Smiley Wink. your program has 3 statements: PROC, TITLE and RUN. That is 3 statements. I only see 1 semi-colon after the RUN. Generally, the code in our courses is syntactically correct. So if you copied the code from the Statistics 1 course and there were missing semi-colons in the PROC PRINT step, this is something that needs to be fixed. What chapter exercise did you cut and paste from?

cynthia

Occasional Contributor
Posts: 19

Re: Setting up Statdat and library

Posted in reply to Cynthia_sas

Hi Cynthia,

I did tried typing the code with the semi colons required. I am still getting the libraries.

Sorry for a really late reply. I couldn't reply I was travelling in India without a source to the internet.

Thanks,

Varun

SAS Super FREQ
Posts: 8,868

Re: Setting up Statdat and library

Posted in reply to varun1220

Hi, Varun:

  The same data setup instructions are used for almost all of our e-learning courses (except for JMP and EG). Task 1 has you issue a LIBNAME statement to point to the location where you will write the files. Task 2 has the code that you cut and paste into your Editor Window to run. If you look in your folders after Task 1, but before Task 2, you will NOT see any data files. But, if you actually perform Task 1 AND Task 2, as shown here:

ECSTAT0_setup.png

Then you should see this message AFTER Task 1

After_Task1.png

(but the folder will be empty until you submit the program in Task 2. AFTER running the Task 2 program, you should see data files, as shown here:

After_Task2.png

cynthai

SAS Super FREQ
Posts: 388

Re: Setting up Statdat and library

Posted in reply to varun1220

Hi, Vann. You said that you tried typing the cod with the semi-colons. Can you show the log where you did that? The log above doesn't show where the semi-colons are present.

Randy

Ask a Question
Discussion stats
  • 7 replies
  • 686 views
  • 2 likes
  • 4 in conversation