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!
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: