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

I want to read values from mytext file

 

mytext

RamabcSamabcKaleabc

 

How to read data this type of file. Please advise.

Also please let me know if i can specify string in dlm option

for e.g dlm='abc'

 

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @Aexor,

 

You can specify strings as delimiters in the DLMSTR= option of the INFILE statement:

/* Create test file for demonstration */

filename myfile temp; 

data _null_;
file myfile;
put 'RamabcSamabcKaleabc';
run;

/* Read the test file */

data want;
infile myfile dlmstr='abc';
input (var1-var3)($);
run;

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hello @Aexor,

 

You can specify strings as delimiters in the DLMSTR= option of the INFILE statement:

/* Create test file for demonstration */

filename myfile temp; 

data _null_;
file myfile;
put 'RamabcSamabcKaleabc';
run;

/* Read the test file */

data want;
infile myfile dlmstr='abc';
input (var1-var3)($);
run;
Aexor
Lapis Lazuli | Level 10
Awesome! I didn't new there is such thing like dlmstr
thanks much 🙂

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 896 views
  • 7 likes
  • 2 in conversation