hi!
i want to make a macro variables,but it can not be used,here is my code; and attachment is my data set.
proc sql;
select f into: g separated by ""
from f;
quit;
%put &g.;
i tried the same and i can see that the macro variable was created without any problem.
I hope you wish to get the value of the f variable within the dataset f into a macro variable called g. if this is the case then your code should work well. Was there any error or warning reported while executing the code.
Thanks,
Jagadish
yes,I can use it with SAS9.2,but SAS9.3 will appear "I/O"error!
Hi:
Very perplexing indeed! I got access to a SAS 9.3 machine and didn't have any issues with the code (see screen shot). I ran the program twice...once with separated by "" (quote-quote) and the second time separated by " " (quote-space-quote) and as you can see, both times worked correctly. Although how you would use the first macro variable without any separators is another puzzle.
However, I'd recommend that you work with Tech Support on this, An I/O error is something that needs to be investigated more thoroughly, where someone looks at your entire log, at the *EXACT* message and at various settings that might impact the execution.
cynthia
Cynthia's suggestion to work with tech support is a good one.
If you want more thoughts from here, might suggest you write a little program that creates work.f, followed by your proc SQL step. Then batch submit that program and see if you get the same I/O error. And if you do, post the code and log here for others to try running and see if they get the same error.
The SQL step you showed could be copied straight out of a macro language course. Must be something odd going on.
--Q.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.