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

I have been using a macro variable with a comma delimited list of variables i want to sent to md5. so it looks like

 

%let keyvars = %bquote(subjid, lbrefid, lbreqno, lbtestr, lbdat, lbtpt, lbrptid, lbmethod);

 

to make it easier to live with I use a put function in creating the checksum variable.

 

data x;

  set y;

  length checksum $32;

  checksum = put(md5(strip(compress(catx(&labkeys),,'c'))), hex20.);

run;

 

I found it helpful to compress out control characters, forget why at this point

 

I was using this to create a composite key to be used to join or compare datasets, It has proven quite reliable until I discovered just this week that two datasets may have the same variable names, labels and values but if the length is different in any of the variables the checksum values will be different.  That kind of blew things up.  I was looking around today and came on this post about a new SHA256 function available in SAS 9.4 M1.

 

http://blogs.sas.com/content/sasdummy/2014/01/18/sha256-function-sas94/

 

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
  • 15 replies
  • 10269 views
  • 8 likes
  • 9 in conversation