Hi KSharp,
Thanks once again.
I got the following error:
series x=x y=y /smoothconnect break;
_____________
22
202
ERROR 22-322: Syntax error, expecting one of the following: ;, ATTRID, BREAK, CLUSTERWIDTH, CURVELABEL, CURVELABELATTRS,
CURVELABELLOC, CURVELABELPOS, DATALABEL, DATALABELATTRS, DISCRETEOFFSET, GROUP, GROUPDISPLAY, GROUPORDER,
LEGENDLABEL, LINEATTRS, MARKERATTRS, MARKERS, NAME, NOMISSINGGROUP, TRANSPARENCY, URL, X2AXIS, Y2AXIS.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
ALSO I wonder if I could do something like (for selecting first date and first TS for subsetting):
data x(where=(date=first.datetimestamp and TS=first.TS));
infile '/folders/myfolders/code12.txt' truncover;
input DateTimeStamp : anydtdtm32. ASN $CWC $ TS $ Mno X Y;
format DateTimeStamp datetime. date date9.;
date=datepart(datetimestamp);
dif_y=dif(y);
dif_x=dif(x);
run;
Your code is not right. The ERROR info say SMOOTHCONNECT is not support by your SAS. Remove it ,should work.
I think I tried a little differently then what you did for calculation of x_dif and y_dif:
data want (drop=LagX LagY);
set mydata;
LagX=lag(X);
LagY=lag(Y);
dif_y=dif(y);
dif_x=dif(x);
Date=datepart(DateTimeStamp); format Date date9.;
if MNo=1 then Lag_X=0; else Lag_X=LagX;
if MNo=1 then Lag_Y=0; else Lag_Y=LagY;
if MNo=1 then xDiff=0; else xDiff = X - Lag_X;
if MNo=1 then yDiff=0; else yDiff = Y - Lag_Y;
run;
here the way I did takes care of situation wherever there is MNo. =1, which means start of a new set of observation (an obviously ASN will get changed as well), so row at MNo=1 will have xDiff=0, yDiff=0, Y_Lag=0, X_Lag=0 (as this is first row of the dateset9 and rest all (X and Y) will be calculated based on lag value. This will not result error in computation like we are getting with X_dif and Y_dif.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.