Hello Sir/Madam,
My data set having three variable two variables are numeric and third is date variable which is in MONYY. format.
I wanted to write a code for
Proc freq data = ;
format Date MONYY.;
tables (NUM QTY) * Date/NOCUM NOFREQ nocol norow;
run;
When i am running this code output is generating but that output is giving me frequency and i wanted actual volume for each NUM variable against Date.
Could you please correct my code or any additional step i wanted to add in it.
THanks,
Nishant
What do you mean by "i wanted actual volume"? Can you post test data and the output required?
You probably want proc tabulate, something like this:
proc tabulate ;
format DATE monyy.;
class NUM QTY DATE;
table DATE, (NUM QTY)*n=' ';
run;
Maybe yo mean sum when you say volume?
Try this:
proc tabulate ;
format DATE monyy.;
class NUM QTY DATE;
table DATE, (NUM QTY)*sum=' ';
run;
Thanks ChrisNZ,
But I have used proc Report and i got what i was expecting. Below is the syntax for review
proc report data = tab;
column NDC Date, QTY;
define NDC / display Group;
define Date / order order=internal;
define QTY / sum;
define Date / across;
run;
Thanks again. Looking forward for more assistance in future 🙂
@nishSAS wrote:
Hello Sir/Madam,
My data set having three variable two variables are numeric and third is date variable which is in MONYY. format.
I wanted to write a code for
Proc freq data = ;
format Date MONYY.;
tables (NUM QTY) * Date/NOCUM NOFREQ nocol norow;
run;
When i am running this code output is generating but that output is giving me frequency and i wanted actual volume for each NUM variable against Date.
Could you please correct my code or any additional step i wanted to add in it.
THanks,
Nishant
The code you posted will create percent values, not frequencies.
You need to describe what you think you mean by "volumne" as Proc Freq will generate counts, percentages, cumulative counts and percentages (which you have turned off) row and column percentages(also turned off) and a number of statistical tests (not requested). But "Volumn" needs clarification.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.