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;

?

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: 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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 597 views
  • 0 likes
  • 3 in conversation