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

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!

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