BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jacksonan123
Lapis Lazuli | Level 10

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.

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 dATA NEW;
74 infile '/folders/myfolders/AptensioPARAM/TEST1.nm7/PARAM.TBL' END=EOF TERMSTR=LF;
75 RUN;
 
NOTE: The infile '/folders/myfolders/AptensioPARAM/TEST1.nm7/PARAM.TBL' is:
Filename=/folders/myfolders/AptensioPARAM/TEST1.nm7/PARAM.TBL,
Owner Name=root,Group Name=root,
Access Permission=-rwxrwxrwx,
Last Modified=07Jun2018:14:54:02,
File Size (bytes)=3168667
 
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.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.02 seconds
 
 
76
77 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
89
 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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;

 

 

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

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;

 

 

ballardw
Super User

@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-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?

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.

jacksonan123
Lapis Lazuli | Level 10
Because I will have 200 such files and trying to convert each would be very
time consuming. A prior response gave the correct answer.

I needed to name the variables and then it an okay.

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!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 546 views
  • 0 likes
  • 3 in conversation