BookmarkSubscribeRSS Feed
Flip
Fluorite | Level 6
Have I lost my mind or is somethin wrong here?

data _null_;
cur_yr = year(today());
cur_day = day(today());
cur_mnth = month(today());
x= catx(put(cur_mnth, z2.), put(cur_day, z2.), put(cur_yr, z4.));
y = compress(put(cur_mnth, z2.)|| put(cur_day, z2.) || put(cur_yr, z4.));
put 'HERE ' cur_mnth cur_day cur_yr ;
put x=;
put y=;
call symput('rundat8', catx(put(cur_mnth, z2.), put(cur_day, z2.), put(cur_yr, z4.)));
run;
%put &rundat8 ;

Results in
HERE 1 28 2011
x=28012011
y=01282011
NOTE: DATA statement used (Total process time):
real time 0.05 seconds
cpu time 0.00 seconds


33 %put &rundat8 ;
28012011

How is the CATX reversing the order of the values?
Same result in 9.1 on Unix and 9.2 on WIN 7
2 REPLIES 2
RickM
Fluorite | Level 6
Check the catx syntax

CATX(separator, string-1 <, ...string-n>)

01 is being used as the separator for the other two strings.
Flip
Fluorite | Level 6
Thanks, I knew it had to be a Friday afternoon brain death.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 776 views
  • 0 likes
  • 2 in conversation