Help using Base SAS procedures

PROC FREQ

Reply
N/A
Posts: 0

PROC FREQ

Hi,

I am very new to SAS

I want to get the number of transactions that happened in a particular hour of the day. I have a log database which has transaction details and time occurred. I run a frequency on the Hour to get number of transactions happened in an hour. If there is no txns happen in a particular hour I want it to be displayed as frequency 0. Is there any way customize PROC FREQ for this.

Thanks in advance
Super Contributor
Posts: 281

Re: PROC FREQ

One way is to modify your table of transactions before your run PROC FREQ so that every hour of the day is represented by a dummy transaction, and there is a weight variable which takes on a value of 0 for those dummy transactions. Real transactions have a weight of 1.

Then in PROC FREQ, use the WEIGHT weightvar /ZEROS; command
Valued Guide
Posts: 2,174

Re: PROC FREQ

try PROC MEANS, which has at least two options that meet what you seek. Copied from the online-doc :

COMPLETETYPES
Create all possible combinations of class variable values

CLASSDATA=
Specify a secondary data set that contains the combinations of class variables to analyze

In that secondary data set you would place the time points at which you want summary.
Perhaps you should follow the examples
http://support.sas.com/onlinedoc/913/getDoc/en/proc.hlp/a000357025.htm

Another way to make PROC MEANS do what you need might be to use the "PRELOADFMT" feature described in the doccumentation and demonstrated at the example http://support.sas.com/onlinedoc/913/getDoc/en/proc.hlp/a000353486.htm

just remember to use a format for the datetime value that gives you the hour of the day ( even if you have to create it ~~> with PROC FORMAT ;-)

all good solutions

good luck
PeterC
N/A
Posts: 0

Re: PROC FREQ

Hey..

Both the solutions worked .. Thank you very much
N/A
Posts: 0

Re: PROC FREQ

Hi,

In PROC FREQ how to remove the proc titles

The FREQ Procedure &
Table of X by Y.

I searched for it and sow that NOHEADER or NOTITLE will do that. I am using SAS 9 on Z/OS .. I tried giving options=notitle;. but its giving some error. Can any one help. Again I am very new to SAS.

Regards
Arun
SAS Super FREQ
Posts: 8,740

Re: PROC FREQ

Hi:
The procedure title "The FREQ Procedure" can be removed with the statement:
[pre]ods noptitle;[/pre]

This is a global statement and will turn off ALL procedure titles until you turn it back on in this session or start a new SAS session. to turn procedure titles back on:
[pre]ods ptitle;[/pre]

cynthia
N/A
Posts: 0

Re: PROC FREQ

Cynthia,

This wont remove the title Table of X by Y right?. I read in some website that there is an option NOTITLE to remove both the titles and its not working for me. Also I read that this option was available from sas 8.2 onwards and they removed it from SAS 9 onwards. Any body have any idea on this?

Regards
Arun
Ask a Question
Discussion stats
  • 6 replies
  • 206 views
  • 0 likes
  • 4 in conversation