05-14-2014 01:28 PM
I received several .asc files, but do not know how to import/read them in sas. I tried to use the code listed below, but since I do not know what variables are in that file, I cannot use "input" statement to rename and define them.
NOTE: The infile 'C:\Core.asc' is:
RECFM=V,LRECL=256,File Size (bytes)=4061484384,
NOTE: 0 records were read from the infile 'C:Core.asc'.
NOTE: The data set sasdat has 1 observations and 0 variables.
Any suggestions are appreciated! THANKS!
05-14-2014 01:49 PM
First step would be to open the file in a plain text reader such as Notepad. I suspect that ASC as a file suffix means it is ASCII which should be plain text.
That may give you some clues.
If the file does not have an obvious delimiter such as comma or space, or less obvious such as a Tab character, you'll likely need to find a document that specifies what columns contain what data, which would be a good idea anyway.
You don't mention the source. If someone sent them they should provide a layout document. If downloaded from a website one would hope a description is available somewhere near where you found the data.
05-14-2014 01:53 PM
I also tried to open it with Notepad, but it is too large that Notepad cannot open it.
Do you mean I cannot import the data file without using the input statement?
05-14-2014 02:45 PM
Another way to look at the file would be either to open in the SAS editor or use the FSLIST command.
You'll need an input statement if trying to read with a datastep. If the file is a delimited text file Proc Import would likely read it but you need to know the delimiter. If it isn't delimited your pretty much going to have to write an input statement at some time.