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.
It's unclear how you are introducing the START and END variables to your DATA step - you would either need an INPUT statement if reading up the values from an external file or you need to have your SET statement coded ahead of the SAS assignment statement where START and END are referenced.
Using the PUTLOG _ALL_; statement for DATA step program diagnosis may help you understand better what's going on at various points during the DATA step execution.