Hello mlogan Examine and modify the following code. I did not use the time portion as part of the date string since the example you presented did not use it either. Run code and examine output, Use as you see fit. data have; input @1 name $char2. @4 invoice_str $CHAR10. @15 inv_time $CHAR5.; /*format invoice_date datetime.;*/ invoice_date = input ( invoice_str, yymmdd10.); datalines; A,2014-02-12,20:12 B,2014-04-01,19:00 D,2014-05-03,23:31 E,2014-07-29,17:10 R,2014-09-15,10:31 F,2015-03-10,12:12 G,2015-06-02,21:18 GF,2015-06-09,10:13 DF,2015-06-27,15:11 ; run; data want; set have; invoice_year=year(invoice_date); invoice_month=PUT(invoice_date, monname3.); invoice_yearmonth=invoice_month || '-' || invoice_year; invoice_quarter=PUT(QTR(invoice_date),3.); run; proc print data=want; run;
... View more