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

Hi all - I googled and only found 1 reference to this specific warning message, which in that case is about SAS "Scalable Performance Data Server" and says that the character string would be truncated to 200 characters and there's a Hotfix.

 

But I am using regular SAS 9.4, and am using the following within proc sql to create an MD5 hash of many fields in my table:

 

md5(compress(
FormDescription||ACRFHDUStateNo||ACRFPIDLName||ACRFPIDMName||ACRFPIDFName||ACRFDemDOB||ACRFHDUFrmCmplDt||
ACRFHDUPerson||ACRFHDUPersonPhone||ACRFHDUReptHD||ACRFHDURepStatus||ACRFDateSaved||ACRFLockSubmit||ACRFLockSubmitted
)) as md5_Small format $hex32.

 

In the log, this message is shown in green:

WARNING: Concatenated strings can be at most 32767 characters.

 

To check, I created a new variable of all those fields concatenated together, and the longest string wasn't more than 115 characters, and nothing was truncated. When I added that new long concatenated string variable to the proc sql command, the referenced warning message was shown twice in the log.

 

I haven't seen this particular warning before, and would just like to make sure it won't bite me if I ignore it as it doesn't seem to apply and the data I'm working with would never seem to exceed even 200 characters, getting nowhere near 32k. Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Try using a CATT() function instead of || to concatenate the variables. If you're using COMPRESS to trim blanks, it may not be needed either, unless you're trying to remove spaces in the middle of the strings.

View solution in original post

4 REPLIES 4
Reeza
Super User
Try using a CATT() function instead of || to concatenate the variables. If you're using COMPRESS to trim blanks, it may not be needed either, unless you're trying to remove spaces in the middle of the strings.
ucdcrush
Obsidian | Level 7
Thank you Reeza, that worked to prevent the warning message. But I wonder what you think may have caused the warning in this case, when the data was nowhere near 32k characters long?
Reeza
Super User

To verify this you would need to look at the variable assigned lengths (not after the compress) to see what SAS is expecting. Using || will concatenate with all trailing spaces and such so it can produce a large string if the lengths of the string are set to a large number. You may have had a string that was larger than expected.

 

That's just a guess though, not really sure. 

https://documentation.sas.com/?docsetId=lrcon&docsetTarget=p00iah2thp63bmn1lt20esag14lh.htm&docsetVe...

ucdcrush
Obsidian | Level 7
Hi Reeza. You're right! Those variables for some reason were 4000 characters each, so I understand why the warning message was showing. Thanks again.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 4 replies
  • 2263 views
  • 2 likes
  • 2 in conversation