ShaneH
ShaneH

Reputation: 23

How to concatenate year(numeric var) and month(character var) as a numeric value on x axis data in scatter plot in sas

I am trying to make a scatterplot of lead enter image description heretime(numeric variable) versus date, while date is separated into year(numeric var) and month(character variable). However, scatter plot can only set two var in sas. I dont know how to concatenate them into one numeric variable.

PROC SGPLOT DATA=hw9.q3;
    scatter Y=LeadTime X = arrivaldatemonth;
RUN;

enter image description here


enter image description here
enter image description here

Upvotes: 0

Views: 189

Answers (1)

Richard
Richard

Reputation: 27508

Compute a SAS date value and use that in your scatter plot.

arrival_datestr = catx('-', '01', arrivalMonth, arrivalYear);
arrival_date = input(datestr, anydtdte20.);
format arrival_date yymon7.;

Upvotes: 1

Related Questions