New SAS User

Completely new to SAS or trying something new with SAS? Post here for help getting started.
BookmarkSubscribeRSS Feed
KeenKe
Calcite | Level 5

So these are the instructions:
a) Open the raw data file ParkAttendance.dat in a simple editor such as
Wordpad and review. In a comment in your program, state the number of
variables and observations.
b) Use the IMPORT procedure to read the raw data file into SAS. View the log
to verify that your data set has the same number of variables an
observation as you stated in part a.
c) Print the data set
Every time I try to import the the dat file I get a message. I am very very new to this. Any help is appreciated.

import 9-10-22.jpg

2 REPLIES 2
Quentin
Super User

It sounds like this is for a class, is that right?  When the instruction say to use the "import procedure" the instructor might be expecting you to write SAS code.  Has the class shown how to write PROC IMPORT code, e.g.:

proc import file=...  out=... ;
run;

?

The Boston Area SAS Users Group is hosting free webinars!
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.
Cynthia_sas
SAS Super FREQ

Hi:

  Are you on step A or step B? The window says "Open" and the message is not in the SAS log, so it looks like you have not submitted any code yet. 

  Step A tells you to open the file in a simple editor. If you want to use SAS Studio to read a .dat file, then you need to right click on the file and choose View as Text File.

  Step B tells you to use the Import Procedure -- please note that under the Tasks and Utilities panel, there IS a utility called Import Data, but if you read the documentation here https://go.documentation.sas.com/api/docsets/webeditorug/3.8/content/webeditorug.pdf you'll see that it says you may have issues with .DAT files, as shown below:

Cynthia_sas_0-1662848309880.png

  However, you can always code the IMPORT Procedure or you can do what the documentation suggests and rename the file as .TXT instead of .DAT In my screen shot below, I show the PROC IMPORT code needed for my file:

Cynthia_sas_1-1662848940527.png

  Hope this helps.

Cynthia

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1157 views
  • 0 likes
  • 3 in conversation