Desktop productivity for business analysts and programmers

New User Question re Displaying date range into quarter

Reply
Contributor
Posts: 42

New User Question re Displaying date range into quarter

I have a data set that has a field that shows dates as (SEE BELOW):

01MAY2012

01JAN2012

01JUL2012

How would I run a summary report and show the dates as quarters?

Q12012

Q22012

Q32012

Q42012

Super User
Posts: 19,006

Re: New User Question re Displaying date range into quarter

In the report somehow you want to apply a format, yyQ, which would come up as 2012Q1

SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition

If you want the Q in front you may have to make your own format.

Super Contributor
Posts: 275

Re: New User Question re Displaying date range into quarter

data have;

input date date9.;

format date date9.;

date1=date;

format date1 yyq10.;

date2=catt('Q',qtr(date),year(date));

cards;

01MAY2012

01JAN2012

01JUL2012

;

proc print;

run;

Ask a Question
Discussion stats
  • 2 replies
  • 144 views
  • 0 likes
  • 3 in conversation