How long is the length of the value that can be put in a macro variable?
Here is my code:
/** Get specific title from the note description dataset **/
proc sql noprint;
select desc_e, desc_f into :T1_EI_TITLE_E, :T1_EI_TITLE_F
from notedesc.no&curr_nt
where code = "T1_EI_TITLE";
quit;
It crashes because the length of both "desc_e" and "desc_f" is too long. Is there a way to make this work?
Thanks a lot in advance 🙂
You were right... it was a semi column issue. Thanks everyone!!
The most common setting for maximum length of a macro variable is 65,534 characters. Do you really expect the values you are reading to be anywhere near that long? More likely there is some other cause of the crash. Have you considered reading the data into a SAS data set rather than into macro variables?
Good luck.
You were right... it was a semi column issue. Thanks everyone!!
If there is a "crash" do you mean errors in the log or SAS quits? If there are errors then post them to help diagnose the problems.
The system option MVARSIZE sets the maximum length of macro variables and may default to 4096.
Try
proc options group=macro; run;
to examine macro related settings.
If the lengths of your data set variable do exceed the MVARSIZE then increase the value:
options mvarsize=9000; or sum such to match.
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.