Length macro variables

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Length macro variables

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 :-)


Accepted Solutions
Solution
‎12-19-2013 04:21 PM
New Contributor
Posts: 2

Re: Length macro variables

You were right...  it was a semi column issue.  Thanks everyone!!

View solution in original post


All Replies
Super User
Posts: 5,082

Re: Length macro variables

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.

Solution
‎12-19-2013 04:21 PM
New Contributor
Posts: 2

Re: Length macro variables

You were right...  it was a semi column issue.  Thanks everyone!!

Super User
Posts: 10,500

Re: Length macro variables

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.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 1145 views
  • 0 likes
  • 3 in conversation