Hello,
I have been trying to modify my code so that I can get a row with all of the same information on each date between two dates. I have tried to research this myself, but I keep getting the error:
The error is saying that one of your two variables is missing. So you need to fix that.
There is no need to use INTNX() and INTCK() when the interval you are moving by is the unit that the values are already stored in. DATE values are stored in DAYS. DATETIME and TIME values are stored in SECONDS.
data have;
set want;
if missing(firstday) or missing(finalday) then put 'ERROR: missing dates' firstday= finalday= ;
else do date= firstday to finalday;
output;
end;
format date date9.;
drop firstday finalday;
run;
data have;
set want;
do date=firstday to finalday;
output;
end;
format date date9.;
drop firstday finalday;
run;
This was the first code I used, and I still get the same error.
The error is saying that one of your two variables is missing. So you need to fix that.
There is no need to use INTNX() and INTCK() when the interval you are moving by is the unit that the values are already stored in. DATE values are stored in DAYS. DATETIME and TIME values are stored in SECONDS.
data have;
set want;
if missing(firstday) or missing(finalday) then put 'ERROR: missing dates' firstday= finalday= ;
else do date= firstday to finalday;
output;
end;
format date date9.;
drop firstday finalday;
run;
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.
Ready to level-up your skills? Choose your own adventure.