I have a data set which looks like this when converted to a *.cvs file. The original name is
param.tbl.
ID TIME CMT ETA1 ETA2 ETA3 ETA4 ETA5
9.00E+00 0.00E+00 1.00E+00 4.29E-01 4.74E-02 -1.42E-05 1.27E-01 9.78E-03
9.00E+00 0.00E+00 2.00E+00 4.29E-01 4.74E-02 -1.42E-05 1.27E-01 9.78E-03
9.00E+00 0.00E+00 3.00E+00 4.29E-01 4.74E-02 -1.42E-05 1.27E-01 9.78E-03
9.00E+00 0.00E+00 4.00E+00 4.29E-01 4.74E-02 -1.42E-05 1.27E-01 9.78E-03
9.00E+00 0.00E+00 5.00E+00 4.29E-01 4.74E-02 -1.42E-05 1.27E-01 9.78E-03
9.00E+00 0.00E+00 6.00E+00 4.29E-01 4.74E-02 -1.42E-05 1.27E-01 9.78E-03
9.00E+00 0.00E+00 7.00E+00 4.29E-01 4.74E-02 -1.42E-05 1.27E-01 9.78E-03
When I run this code:
dATA NEW;
infile '/folders/myfolders/AptensioPARAM/TEST1.nm7/PARAM.TBL' END=EOF TERMSTR=LF;
RUN;
I get this response either with or without the termstr=lf, which I used since I thought that it may be a unix file. I need to know what type of input statement do I need to read this file?
I get this dialog box:
The table can't be opened because it does not contain any columns.
I get this log.
You never defined any variables. Or told the data step to read from the file at all. That is why you got:
NOTE: 0 records were read from the infile '/folders/myfolders/AptensioPARAM/TEST1.nm7/PARAM.TBL'. NOTE: The data set WORK.NEW has 1 observations and 0 variables.
Tell it to try actually reading the data. You probably want to skip over that header line.
data NEW;
infile '/folders/myfolders/AptensioPARAM/TEST1.nm7/PARAM.TBL'
firstobs=2 truncover
;
input ID TIME CMT ETA1 ETA2 ETA3 ETA4 ETA5;
run;
You never defined any variables. Or told the data step to read from the file at all. That is why you got:
NOTE: 0 records were read from the infile '/folders/myfolders/AptensioPARAM/TEST1.nm7/PARAM.TBL'. NOTE: The data set WORK.NEW has 1 observations and 0 variables.
Tell it to try actually reading the data. You probably want to skip over that header line.
data NEW;
infile '/folders/myfolders/AptensioPARAM/TEST1.nm7/PARAM.TBL'
firstobs=2 truncover
;
input ID TIME CMT ETA1 ETA2 ETA3 ETA4 ETA5;
run;
@jacksonan123 wrote:
I have a data set which looks like this when converted to a *.cvs file. The original name is
param.tbl.
ID TIME CMT ETA1 ETA2 ETA3 ETA4 ETA5
9.00E+00 0.00E+00 1.00E+00 4.29E-01 4.74E-02 -1.42E-05 1.27E-01 9.78E-03
9.00E+00 0.00E+00 2.00E+00 4.29E-01 4.74E-02 -1.42E-05 1.27E-01 9.78E-03
9.00E+00 0.00E+00 3.00E+00 4.29E-01 4.74E-02 -1.42E-05 1.27E-01 9.78E-03
9.00E+00 0.00E+00 4.00E+00 4.29E-01 4.74E-02 -1.42E-05 1.27E-01 9.78E-03
9.00E+00 0.00E+00 5.00E+00 4.29E-01 4.74E-02 -1.42E-05 1.27E-01 9.78E-03
9.00E+00 0.00E+00 6.00E+00 4.29E-01 4.74E-02 -1.42E-05 1.27E-01 9.78E-03
9.00E+00 0.00E+00 7.00E+00 4.29E-01 4.74E-02 -1.42E-05 1.27E-01 9.78E-03When I run this code:
dATA NEW; infile '/folders/myfolders/AptensioPARAM/TEST1.nm7/PARAM.TBL' END=EOF TERMSTR=LF; RUN;
I get this response either with or without the termstr=lf, which I used since I thought that it may be a unix file. I need to know what type of input statement do I need to read this file?
If you converted your TBL to CSV then why are you reading the TBL file????
Or why are showing a not-actually-a csv file if you want to read the TBL?
Copy the first few rows from the TBL file and paste them into a code box on the forum opened using the {I} icon to show us what the file actually looks like.
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!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.