Newer EG user here and I am trying to import a .DAT file where the Field delimiter is ~##~ and Record delimiter is ~@^*^@~
In EG, the Delimited Fields "Other" option appears to only allow one character.
Does anyone know if this delimiter type is possible?
Thanks in advance
Now THAT's funky data!
I took at quick look at EG, and I don't see a way.
Are you experienced enough with the SAS tools to write some SAS code and run it in a program node in EG? Doing something like this is trivial with the underlying SAS programming language.
Another option I can think of is to use something like Notepad to convert all of your multi-character delimiters to a single character. ~ and | are popular, just make sure first that whatever it is doesn't appear in the dataset already.
Tom
Are you really trying to read a WORD file? If not can you post some of the data as text instead of as WORD attachment. If you just pasted a photograph of your data into the WORD file then post the photograph directly into your posting instead.
You can use a simple data step to see what is in the file. Something like:
data _null_;
infile 'myfile.dat' obs=3;
input;
list;
run;
Or perhaps you want to treat it as a binary file since you apparently have "records" instead of "lines". In that case you might just read the first few hundred bytes of the file. Say 300 bytes in blocks of 100 each.
data _null_;
infile 'myfile.dat' recfm=f lrecl=100 obs=3;
input;
list;
run;
Now THAT's funky data!
I took at quick look at EG, and I don't see a way.
Are you experienced enough with the SAS tools to write some SAS code and run it in a program node in EG? Doing something like this is trivial with the underlying SAS programming language.
Another option I can think of is to use something like Notepad to convert all of your multi-character delimiters to a single character. ~ and | are popular, just make sure first that whatever it is doesn't appear in the dataset already.
Tom
great idea, thank you
Here's a suggestion that may get you something that works for that file:
Post some example text in a code box opened on the forum with the {I}. The picture you posted does not include an actual example of your end of record appearance. The example doesn't need to contain any sensitive values and would be a good idea to contain at least 3 records so we can see two or more "end of record"
Code would be needed but he field delimiter can be addressed with the DLMSTR option on an infile statement:
data example; infile datalines dlmstr="~##~"; input a $ b c; datalines; abc~##~1.23~##~999 ;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.