BookmarkSubscribeRSS Feed
coba
Calcite | Level 5

Thank you for your help.

FriedEgg
SAS Employee

proc format;

value myfmt (multilabel)

      1 = 1

  1 - 2 = 2

  1 - 3 = 3

  1 - 4 = 4

  1 - 5 = 5

  1 - 6 = 6

  1 - 7 = 7

  1 - 8 = 8

  1 - 9 = 9

  /* etc... */

;

run;

data have;

format date eurdfde9.;

input type1 $ type2 value date eurdfde9. type3 $;

year=year(date);

month=month(date);

cards;

A 1 458 01-Jan-11 ba

A 1 492 01-Mar-11 ba

A 1 9 01-Apr-11 ba

A 1 1 01-May-11 ba

A 1 333 01-Jun-11 ba

A 1 1 01-Jul-11 ba

A 2 14 01-Jan-11 ba

A 2 20 01-Feb-11 ba

A 2 18 01-Mar-11 ba

A 2 13 01-Apr-11 ba

A 2 4605 01-May-11 ba

A 2 1599 01-Jun-11 ba

A 2 58 01-Jul-11 ba

A 3 7 01-Jan-11 ba

A 3 3 01-Feb-11 ba

A 3 4 01-Mar-11 ba

A 3 3 01-Apr-11 ba

A 3 4 01-May-11 ba

A 3 2 01-Jun-11 ba

B 1 5 01-Feb-11 ba

B 1 2 01-Mar-11 ba

B 1 7 01-Apr-11 ba

B 1 1 01-May-11 ba

B 1 4 01-Jul-11 ba

B 1 20 01-Mar-11 ba

B 2 11 01-Apr-11 ba

B 2 7 01-Jun-11 ba

B 2 70 01-May-11 ba

B 2 1 01-Jan-11 ba

B 2 1 01-Feb-11 ba

B 2 1 01-Mar-11 ba

B 2 1 01-Apr-11 ba

B 3 1 01-May-11 ba

B 3 1 01-Jun-11 ba

B 3 1 01-Jul-11 ba

B 3 1 01-Jan-11 ba

B 3 1 01-Apr-11 ba

;

run;

proc means data=have sum nonobs nway noprint;

class type1 type2 type3 year;

class month /mlf;

var value;

format month myfmt.;

output out=temp(drop=_:) sum=total_value;

run;

data want;

format date eurdfde9.;

set temp;

date=mdy(month*1,1,year);

drop month year;

run;

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand in the Innovate Hub.

Watch 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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 16 replies
  • 10014 views
  • 0 likes
  • 4 in conversation