BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MyleneC
Calcite | Level 5

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 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
MyleneC
Calcite | Level 5

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

View solution in original post

3 REPLIES 3
Astounding
PROC Star

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.

MyleneC
Calcite | Level 5

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

ballardw
Super User

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 2904 views
  • 1 like
  • 3 in conversation