How do I go about creating raw data file in SAS Enterprise Guide?
Later I intend to use INFILE statement and INPUT to access this file and its contents.
Is it even possible to do so?
Regards,
Dhanashreeata
Hope this is what you were expecting
data _null_;
file "E:\source\test.txt" print;
input name$ age;
if _n_=1 then put @1 "name" @10 "age";
put @1 name @10 age;
cards;
alice 30
william 20
;
run;
Thanks,
Jagadish
Yes, that is what I am looking for. Although .dat extension. So after I have created that file, I am having following script to access its contents and generate data set:
filename testref "/home/dhanashree.gadka/user/DUG/test.dat";
data work.vegd;
infile testref;
input vname $ vfreq $;
run;
I see this error in Log:
ERROR: Invalid logical name.
ERROR: Error in the FILENAME statement.
ERROR: Physical file does not exist, /sso/biconfig/930/Lev1/SASApp/TESTREF.
Am I missing something?
And in theory, what is the best way to peek at raw data files for data examination purposes so that one can figure out what is the data structure and how to write the input statements.
Thanks so much.
From the log, it looks like you are using a SAS installation that hosted with SAS OnDemand. Is that correct? If so, be sure to consult the appropriate guidance for how to access/create external files in this environment.
With SAS Enterprise Guide, you can easily discover the structure of a text-based data file by opening it with File->Import Data. The Import Data task will generate a DATA step with INPUT statements to read your file structure.
Chris
i believe the code is correct.
Need to check the path. Also please try to give a different filename, instead of testref try testr. Though testref should also work, but since it is throwing an error try to replace the name.
Thanks,
Jagadish
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.