ID TIME CMT Y1 Y2 1.0000E+00 0.0000E+00 1.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 1.0000E+00 1.0000E+00 2.4000E+01 2.4000E+01 2.4000E+01 4.2881E+00 4.9617E+01 ID TIME CMT Y1 Y2 1.0000E+00 0.0000E+00 1.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 1.0000E+00 2.0000E+00 0.0000E+00 0.0000+00
The inserted data file has the labels ID Time etc inserted whenever the subject number repeats.
data one;
infile '/folders/myfolders/partialauc/testsimjuvpilot3.fit' DLM='09'X dsd truncover;
input chk $ @;
if chk='id' then delete;
else input @1 id time cmt;
drop chk;
run;
proc print;
run;
The inserted SAS code contained DLM='09'x which worked with another text file as suggested by an answer to my prior post.
However I get the following error:
NOTE: The infile '/folders/myfolders/partialauc/testsimjuvpilot3.fit' is:
Filename=/folders/myfolders/partialauc/testsimjuvpilot3.fit,
Owner Name=root,Group Name=root,
Access Permission=-rwxrwxrwx,
Last Modified=06Mar2020:23:47:59,
File Size (bytes)=10325855
NOTE: Invalid data for id in line 1 1-305.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
1 ID TIME CMT Y1 Y2 CP1 CP2 DV MDV
101 X COUNT RHYD RHYL RMETD RMETL CDLV CLLV CVD
201 CVL CRESI CWRESI CRES CWRES DV PRED RES
301 WRES 305
chk=ID id=. time=. cmt=. _ERROR_=1 _N_=1
NOTE: Invalid data for id in line 2 1-312.
I didn't put in all of the data but the error is still applicable. Can someone tell me why the DLM='09'X addition to the input line failed to work for this input data? Since it did not work how should the input line be modified?
Based on the data you've posted looks like string ID is all uppercase.
May be try in your code:
if upcase(chk)='ID' then delete;
Open the file with a proper text editor, preferably Notepad++.
Open a window here with the {i} button.
Copy/paste a few lines into that subwindow.
Send the post.
Or rename the file to something.txt, so you can attach it to your post.
Only then will we be able to properly inspect the file's contents. Note that Notepad++ provides a hex view which assists in finding what delimiters you need. You might also find, on opening, that your file does not use delimiters, but fixed-width columns.
Based on the data you've posted looks like string ID is all uppercase.
May be try in your code:
if upcase(chk)='ID' then delete;
There are no tabs in the data you posted, so this works:
data want;
input@;
if index(upcase(_infile_),'ID')
then delete;
else input id time cmt;
datalines;
ID TIME CMT Y1 Y2
1.0000E+00 0.0000E+00 1.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 1.0000E+00 1.0000E+00 2.4000E+01 2.4000E+01 2.4000E+01 4.2881E+00 4.9617E+01
ID TIME CMT Y1 Y2
1.0000E+00 0.0000E+00 1.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 1.0000E+00 2.0000E+00 0.0000E+00 0.0000+00
;
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.