- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
FILENAME msghtml "//mypath/myfile.txt"
data _null_;
length text $32767;
retain text '';
infile msghtml flowover dlmstr='//' end=last;
input;
text = catx(text,_infile);
run;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!