I'm working with instrumentation data. I have several problems that I don't know how to deal with. I have some records that contain time values. They aren't clock times, they are durations (like elapsed time). I've looked through a bunch of SAS doc and I haven't found what I'm looking for. According to proc contents, the fields are defined 'num 5' and they have formats of time12.2. I want to use PROC SQL for a series of queries that I need to run. I need to do two things. I need to add several time variables on each row, subtract that result from another time variable on that row, and then I need to sum those rows - to compute various totals. This is the general problem, but I want to take this one step further and unclutter my SQL. proc sql; select datepart(smftime) as system_date format yymmddd10., qwhsssid as ssid, sum(qpactjst) as cpu_time, count(*) as count from db2acctp where qwhsssid = 'DB2A' group by ssid, system_date The SQL above is from a different thread and this is a question for the having to do with this question and SQL I copied into this thread. The main reason I'm asking this is when I start adding fields to my SQL, it's going to be a cluttered mess. So, my second question is whether there is a way in SAS, that I can declare the format of a column ahead of the SQL so that I only need the column (and may the 'AS' verb) in the SQL. For this thread, I'm going to have to sum 10 variables and then subtract these 10 variables from another variable to get this value for every row and take the results (about 100K rows) and sum the result like the SQL above.
... View more