BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BETO
Fluorite | Level 6

HI,

1) When I run the Proc Tab I get the date range out of sequence. The date

should be  01/01/2012-01/07/2012,  01/08/2012-01/14/2012 ...

DateRange
1/1/2012 - 1/7/20121/15/2012 - 1/21/20121/8/2012 - 1/14/2012
NTotalPercentNTotalPercentNTotalPercent
NNN

ODS HTML3 file='H:\Test.xls' style=minimal;

options missing=' ';

proc tabulate data=Test1 f=10.2 S=[backGROUND=light yellow  JUST=C] noseps;

  where Item='Shoe';

  class DateRange VSB Compliance;

  classlev Compliance /S=[BACKGROUND=light grey];

  keylabel pctn ='PERCENT'

           all='Total';

  table  VSB*(Compliance all), daterange*(n='N'*f=8.0 all pctn<Compliance all>='Percent')

   /RTS=50 MISSTEXT ='0' box=Shoe    ;

run;

ODS HTML3 close;

2)In the same Proc Tab I'm trying get Total at the end of the table. It doesn't summerize each week with Total at end of the 3 weeks.

3) I've research the net and look in my SAS book and fig out how to add the % in the percent Column.Is that possible ?

Thanks for your assistance 

DateRange
1/1/2012 - 1/7/20121/15/2012 - 1/21/20121/8/2012 - 1/14/2012
NTotalPercentNTotalPercentNTotalPercent
NNN
VSBCompliance11100000000
ShoeYES
Total11100000000
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Apply a picture format

proc format;

    picture tabpct (round)

    low-high='009%';

run;

proc tabulate data=Test1 f=10.2 S=[backGROUND=light yellow  JUST=C] noseps;

  where Item='Shoe';

  class DateRange VSB Compliance;

  classlev Compliance /S=[BACKGROUND=light grey];

  keylabel pctn ='PERCENT'

           all='Total';

  table  VSB*(Compliance all), daterange*(n='N'*f=8.0 all pctn<Compliance all>='Percent'*f=tabpct.)

   /RTS=50 MISSTEXT ='0' box=Shoe    ;

run;

View solution in original post

5 REPLIES 5
ballardw
Super User

Try

1)

CLASS DateRange /order = data;

Class VSB Compliance;

This may require sorting your data by DateRange

2) Not quite sure which total you may want but try:

VSB*(Compliance all) All,  /* should provide a total row at bottom*/

3) Due you want a percent sign to appear in the cells of the Table?

Or do you want a percent sign in the column heading?

BETO
Fluorite | Level 6

What I'm looking on the total is something like this. The % would be in the number for example 30.00% and 70.00% 14.29% 85.71%...Thanks

DateRange
1/1/2012 - 1/7/20121/15/2012 - 1/21/20121/8/2012 - 1/14/2012
NTotalPercentNTotalPercentNTotalPercentTotal
NNN
VSB
ShoeCompliance33300001114.29423.52
NO
YES77700006685.711376.47
Total10101000007710017100
Reeza
Super User

Apply a picture format

proc format;

    picture tabpct (round)

    low-high='009%';

run;

proc tabulate data=Test1 f=10.2 S=[backGROUND=light yellow  JUST=C] noseps;

  where Item='Shoe';

  class DateRange VSB Compliance;

  classlev Compliance /S=[BACKGROUND=light grey];

  keylabel pctn ='PERCENT'

           all='Total';

  table  VSB*(Compliance all), daterange*(n='N'*f=8.0 all pctn<Compliance all>='Percent'*f=tabpct.)

   /RTS=50 MISSTEXT ='0' box=Shoe    ;

run;

BETO
Fluorite | Level 6

Hi Ballardw,

I fig out with your help to get the totals . The question is now how to add  % symbol for example 30.00% and 70.00% 14.29% 85.71%...Thanks

BETO
Fluorite | Level 6

Thank You guys for the assitance ..  Reeza I need 2 dec points so I added 009.00% an it worked ... Hi Ballardw, Your answer help a lot I feel bad that I can't split  Correct Answer  or helpful ...  You guys help a lot  and I learn something  

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1294 views
  • 3 likes
  • 3 in conversation