Hi, I’m trying to convert two character variables into time variables (HHMM) then find the difference between the two variables and put that into a comma delimited text file. I have been able to get variables from my SAS database to go into the text file, but not the variables that I create myself. Here is my code and error message. How can I create a new variable (length) that shows the difference between the two other variables, and get it into the text file? Thanks.
libname r1 '/stuff/things/r1';
libname r2 '/stuff/things/r2';
libname r3 '/stuff/things/r3';
libname r4 '/stuff/things/r4';
data _null_;
begin = input(START, TIME4.);
finish = input(END, TIME4.);
length = finish - begin;
file '/location/place/port.txt' dlm=',';
set r1.ld(keep= START END length )
r2.ld(keep= START END length )
r3.ld(keep= START END length )
r4.ld(keep= START END length );
put START END length ;
run;
ERROR: The variable length in the DROP, KEEP, or RENAME list has never been referenced.
... View more