create a calendar with events

Reply
Occasional Contributor
Posts: 16

create a calendar with events

hi, I have a spreadsheet with Dates, and events for two groups, I want to create a monthly calendar from this. Is there any way to do?

for example, the spreadsheet is with hearder: DATE, GROUP_A, GROUP_B

the data in the file is like below:

1-JAn-2014, A_EVENT1, B_EVENT2

2-Jan-2014, A_EVENT2

3-JAn-2014,                  ,B_EVENT3

3-Jan-2014,                   ,B_EVENT4

...

Appreciate the input  

Frequent Contributor
Posts: 106

Re: create a calendar with events

hi,

can you elaborate your requirement , these events occur on these dates for every month?? and you just want to populate these events for every month on same dates?

Super Contributor
Posts: 307

Re: create a calendar with events

If you plan to create a summary calendar only, then one strategy is to collapse all of your events into one variable.

For example:

events = GROUP_A || ' ' || GROUP_B

Make sure the data being read into PROC CALENDAR has one "events" observation per day.

PROC Star
Posts: 7,468

Re: create a calendar with events

: not necessary (I don't think).  The following will handle the multiple dates shown in the example:

data events_in;

  informat date date9.;

  format date date9.;

  input date (groupa groupb) ($);

  cards;

1jan2014 A_EVENT1 B_EVENT2

2jan2014 A_EVENT2 .

3jan2014 . B_EVENT3

3jan2014 . B_EVENT4

;

data events (keep=date event long _cal_);

  set events_in;

  long=1;

  if not missing(groupa) then do;

    event=groupa;

  _cal_='CAL1';

    output;

  end;

  if not missing(groupb) then do;

    event=groupb;

  _cal_='CAL2';

    output;

  end;

run;

proc sort data=events;

   by date;

run;

options nodate pageno=1 linesize=132 pagesize=60;

proc calendar data=events;

   start date;

   dur long;

   title1 'Summer Planning Calendar:  Julia Cho';

run;

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