DATA Step, Macro, Functions and more

getting totals of individual variable in a column

Reply
Occasional Contributor
Posts: 19

getting totals of individual variable in a column

[ Edited ]

9.3 Enterprise Guide

 

I have sas progam that inports log file info which looks like this - but it's thousands of lines..

 

Form, Status, InputDate, ProcessedDate
4    `R    `05/09/2017 11:21:37      `05/09/2017 11:22:15

4A   `R    `05/09/2017 11:21:32      `05/09/2017 11:22:18

13    `A    `05/09/2017 11:21:47      `05/09/2017 11:22:21

 

The sas program does a great job of caluclating the average time between the input date and received date (latency) for all the forms type based upon interval I use (say 15mins) via  a data statement (data t (keep=int_dt date hour latency type status) ;)

 

Any my data comes out like this ..

 

typestatusint_dtlatencydatehour
13A09MAY17:11:21:00252094811
47A09MAY17:11:21:00692094811
28A09MAY17:11:21:00652094811
4A09MAY17:11:21:002192094811
4A09MAY17:11:21:15202094811
13A09MAY17:11:21:15302094811
4A09MAY17:11:21:15292094811
4AA09MAY17:11:21:15282094811
4AR09MAY17:11:21:15282094811
13A09MAY17:11:21:15322094811
4AR09MAY17:11:21:15592094811
4A09MAY17:11:21:15202094811

 

It's great and I love it - and it provides a great overall picture of everything, but now I need to drill down a bit... Basically I need to seperately split out the different form types 4, 4a, 13, etc, in addition to the overall picture and having a problem, thinking i could use a proc summary from t (name of data statement - see above) to split it by individual form types, but im not making much headway...... Any help is appreciated...

 

Super User
Posts: 17,747

Re: getting totals of individual variable in a column

PROC SUMMARY or MEANS is the correct procedure. 

Put you're group variable into the CLASS variable list. 

 

If it's not working, please post what you've tried. 

Super User
Posts: 10,466

Re: getting totals of individual variable in a column

What would your output look like for the example data? Your topic sas "getting totals" but you don't specify for which variable. Everything except Type and Status could be summed. Do you want a data set or a report type summation? If you want a data set what should the output look like as in what other variables should be present and what role, if any would Status,  Int_DT, date or hour play?

Occasional Contributor
Posts: 19

Re: getting totals of individual variable in a column

To answer the question of what i would think it would look like, it's be muliple proc summary for each type of form like for 13 type forms

 

typestatusint_dtlatencydatehour
13A09MAY17:11:21:00252094811
13A09MAY17:11:21:15302094811
13A09MAY17:11:21:15322094811

 

and type 4

 

typestatusint_dtlatencydatehour
4A09MAY17:11:21:002192094811
4A09MAY17:11:21:15202094811
4A09MAY17:11:21:15292094811
4A09MAY17:11:21:15202094811

 

and so on... it's just seperating out things by form type...

 

From there I can total things out individually by each form type as necessary...

 

Thanks in Advance

Ask a Question
Discussion stats
  • 3 replies
  • 117 views
  • 0 likes
  • 3 in conversation