Help using Base SAS procedures

Difficulty opening dat file

Reply
N/A
Posts: 0

Difficulty opening dat file

Hey guys I know this is a really silly thing to get stumped on but I'm having trouble opening one of my dat files. Im using SAS portable 9.1.3 and when I try to open dat files on my computer my SAS program fails to load and just crashes.

The information can be seen here.

1 The SAS System 22:33 Thursday, August 18, 2010

NOTE: Copyright (c) 2002-2003 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) 9.1 (TS1M3)
Licensed to DANKOOK UNIVERSITY, Site 0038249001.
NOTE: This session is executing on the XP_PRO platform.



NOTE: SAS 9.1.3 Service Pack 4

NOTE: SAS initialization used:
real time 0.64 seconds
cpu time 0.71 seconds


NOTE: AUTOEXEC processing beginning; file is C:\Program Files\SAS\SAS 9.1\autoexec.sas.


NOTE: AUTOEXEC processing completed.

WARNING: Truncated record.
WARNING: A line of input contains one or more null (hexadecimal 00) characters, which may cause the
SAS System to ignore part of the line. The line, with null characters printed as question
marks, is:

1 Âê?`³Ͻ’ Ç1Œ"" 2"2  SAS
__
__
__
180
180
180
1 ! FILEAGPOP DATA
1 ! ú~ÂØuÃÔAú~ÂØuÃÔA Vã@ Vã@  @  8.0101M0WIN_PRO
1 !

ERROR 180-322: Statement is not valid or it is used out of proper order.
ERROR 180-322: Statement is not valid or it is used out of proper order.
ERROR 180-322: Statement is not valid or it is used out of proper order.

ERROR: Errors printed on page 1.
ERROR: Errors printed on page 1.
ERROR: Errors printed on page 1.

NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
real time 0.65 seconds
cpu time 0.73 seconds

Thanks a lot for your help and support. Ciao!
Super Contributor
Posts: 292

Re: Difficulty opening dat file

Posted in reply to deleted_user
please post the code that you are using to read the dat file as well as a line of data from the dat file
N/A
Posts: 0

Re: Difficulty opening dat file

Hi Bill,

I'm not using any code to try and read the dat file. I just tried right clicking the dat file and running using SAS. It worked properly without error messages at my university.

You can have a look at the dat file here:

http://www35.zippyshare.com/v/59089508/file.html

Thanks
N/A
Posts: 0

Re: Difficulty opening dat file

Posted in reply to deleted_user
Basically I just want to display the region country and state variables on SAS to look at the data more carefully. But the data does not show as a table on SAS like it does in my university which uses SAS 9.1.3 aswell (not portable) so I can make sure what I'm doing is correct and matches with my data.
Valued Guide
Posts: 634

Re: Difficulty opening dat file

Posted in reply to deleted_user
After working through Cynthia's suggestions, take a look at your AUTOEXEC.SAS program and make sure there is nothing in it that will carryover to the opening of the VIEWTABLE.
N/A
Posts: 0

Re: Difficulty opening dat file

Yes I noticed this yesterday and did use the set command which showed the output fine. However I still cannot get the data to reach viewtable mode when I double click on it at home while it works perfectly fine on the computer labs in my university. Thanks for the support guys, its been very helpful so far.
SAS Super FREQ
Posts: 8,868

Re: Difficulty opening dat file

Posted in reply to deleted_user
Ah, in order to make Viewtable work, you need to have the SAS/FSP product installed. I wonder whether:
1) you are using the SAS Learning Edition or
2) you have an installation of SAS at home that does NOT have SAS/FSP installed

The reason I ask about the SAS Learning Edition is that you might be receiving an error message that says:
ERROR: Module SASZAF not found in search paths.

as described in this note:
http://support.sas.com/kb/9/833.html

If the answer is #1, then your only alternatives with the Learning Edition are to use the Report Editor, as described in the above note or to use PROC PRINT to view the table, since Viewtable mode is not available with the Learning Edition. If the answer is #2, (that SAS/FSP is not installed), then you might check at your school to see whether you are able to have SAS/FSP installed.

cynthia
Trusted Advisor
Posts: 2,116

Re: Difficulty opening dat file

Posted in reply to deleted_user
Did you rename the file? It looks like it is trying to run it as a SAS program instead of treating it as data. If you are in Windows, you may have gotten your file associations screwed up (You can fix that by re-registering SAS. Call tech support for details on that.)
N/A
Posts: 0

Re: Difficulty opening dat file

How about reading the data in SAS?

data Analysis;
infile 'agpop.dat';
run;

proc print data=Analysis;
run;

Doesnt work either :/
SAS Super FREQ
Posts: 8,868

Re: Difficulty opening dat file

Posted in reply to deleted_user
Hi:
When I visit the web site, it says that the file is a SAS proprietary format file:
[pre]
You have requested the file:
Name: agpop.sas7bdat
Size: 0.49 MB
Uploaded: 18-08-2010 15:46
Last download: 18-08-2010 15:46
[/pre]


Which means that if you click on the file name on a machine where SAS is installed, the file should just open, probably in Viewtable mode. Possibly in SAS Enterprise Guide, possibly in SAS Display Manager, possibly in SAS Universal Viewer. There is a HUGE difference between a .DAT (raw ASCII text file) and a .SAS7BDAT file (a SAS proprietary format file). The .DAT file you would need to read with an INFILE and INPUT statement. The .SAS7BDAT file you would need to read with a simple SET statement after you had pointed to the data location with a LIBNAME statement.

If you save the file as the name is represented: agpop.sas7bdat, in the physical directory c:\mydir\mydata
(so that the fully qualified path name was c:\mydir\mydata\agpop.sas7bdat)
then the only SAS syntax you would need to read the file would be this:

[pre]
libname perm 'c:\mydir\mydata';

proc print data=perm.agpop;
title 'Analysis of AGPOP data';
run;

*** OR;

data analysis;
set perm.agpop;
run;

proc contents data=analysis;
run;

proc print data=analysis;
run;
[/pre]

Do you have SAS on the machine where you are attempting to read this file?

cynthia
Valued Guide
Posts: 2,177

Re: Difficulty opening dat file

Posted in reply to deleted_user
rogerD

looks like when your file is opened, SAS is treating the file like a SAS program.
Probably it is not a SAS program.
I sometimes get this trouble in Windows -Vista. It is a "file associations" problem.

"DAT file"
sounds like you don't know what data type you are reading -
so why open with SAS?

If the file has type SAS7BDAT then it should be a SAS system data set, but then it is hard to understand why your SAS system environment does not know that the file is NOT a SAS program!

You talk about "SAS portable".
Please could you explain why this is different from SAS on a laptop or SAS on a desktop?

peterC
N/A
Posts: 0

Re: Difficulty opening dat file

Hey peter,

Yes a DAT file is just a raw data file but a SAS7BDAT is a SAS data file which should open and display on viewtables on SAS(basically looks like a excel table with the variables and data) when you right click the sas data file and choose open in SAS. This works perfectly fine on my university computers but not on the version I have at home, which was basically given to me by the university anyway. I have asked my head lecturer but she does not seem to know what is exactly wrong.
SAS Super FREQ
Posts: 8,868

Re: Difficulty opening dat file

Posted in reply to deleted_user
Hi:
As I said previously, VIEWTABLE will only work if you also have the SAS/FSP (Full Screen Product) product installed. I wonder whether:
1) you are using the SAS Learning Edition or
2) you have an installation of SAS at home that does NOT have SAS/FSP installed

The reason I ask about the SAS Learning Edition is that you might be receiving an error message that says:
ERROR: Module SASZAF not found in search paths.

as described in this note:
http://support.sas.com/kb/9/833.html

If the answer is #1, then your only alternatives with the Learning Edition are to use the Report Editor, as described in the above note or to use PROC PRINT to view the table, since Viewtable mode is not available with the Learning Edition. If the answer is #2, (that SAS/FSP is not installed), then you might check at your school to see whether you are able to have SAS/FSP installed.

When you check at your school, your lecturer may not actually know the question about SAS/FSP -- you might have to find out who the SAS Administrator is and ask whether it's possible to install SAS/FSP.

If you have the Learning Edition, you may just have to use PROC PRINT.

With SAS 9.2, you can get the SAS Universal Viewer, which will open SAS datasets into a mode similar to VIEWTABLE. Again the SAS Administrator can help you figure out what your particular situation is. (Learning Edition, need FSP or need SAS Universal Viewer).

cynthia
Valued Guide
Posts: 2,177

Re: Difficulty opening dat file

Posted in reply to deleted_user
rogerD

may I ask again --> is your "dat file" a "sas7bdat file"?

and --> on what version of windows does your "portable" run?

peterC
SAS Super FREQ
Posts: 8,868

Re: Difficulty opening dat file

Peter:
If you go to the posted site:
http://www35.zippyshare.com/v/59089508/file.html

you will find that the file is AGPOP.SAS7BDAT. I don't know what the OP meant by SAS "portable" -- I suspect the install is either the Learning Edition or a Base SAS installation without FSP.

cynthia
Ask a Question
Discussion stats
  • 15 replies
  • 972 views
  • 0 likes
  • 6 in conversation