FILENAME msghtml "//mypath/myfile.txt"
data _null_;
length text $32767;
retain text '';
infile msghtml flowover dlmstr='//' end=last;
input;
text = catx(text,_infile);
run;You are creating the value in a dataset variable, but since you are using _NULL_ dataset it is not being written anywhere. If you want to store it in a macro variable then you need to add a CALL SYMPUTX() function call. Use the LAST variable you created with the INFILE statement to know when to create the macro variable.
The DMLSTR= option is doing nothing in your data step. Are you trying to remove end-of-line comments that are marked with // ? If so then try reading the line into a variable instead of using the _INFILE_ automatic variable.
data _null_;
length sql line $32767;
retain sql ;
infile msghtml flowover dlmstr='//' end=last;
input line ;
sql = catx(' ',sql,line);
if last then call symputx('sql',sql);
run;
You are creating the value in a dataset variable, but since you are using _NULL_ dataset it is not being written anywhere. If you want to store it in a macro variable then you need to add a CALL SYMPUTX() function call. Use the LAST variable you created with the INFILE statement to know when to create the macro variable.
The DMLSTR= option is doing nothing in your data step. Are you trying to remove end-of-line comments that are marked with // ? If so then try reading the line into a variable instead of using the _INFILE_ automatic variable.
data _null_;
length sql line $32767;
retain sql ;
infile msghtml flowover dlmstr='//' end=last;
input line ;
sql = catx(' ',sql,line);
if last then call symputx('sql',sql);
run;
Perfect, that did the trick - thank you very much! I found a lot of this code elsewhere and tried to apply it to my case, but this has taught me more in this area. Thanks again!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.