08-06-2016 06:35 PM - last edited on 08-07-2016 12:30 AM by Reeza
In my data, the date variables values contain the following values.
How to read the date1 values to get the output. Thanks Please help
08-06-2016 09:17 PM
Thanks for the hint @PGStats
I've already spent time for a solution to your question but I've now realized that you A) already asked this question before and B) don't give a lot of feedback and/or mark questions as answered.
So waiting until you've done your bit before posting anything.
08-06-2016 11:54 PM
I still remember there are many people have already answered your question. Wouldn't those code work for you ? data have; input date1 $20.; cards; 12/May/2015 UN/UNK/2004 UN/Aug/2000 un/UNK/2001 10/UNK/2008 un/Mar/2003 un/UNK/un ; run; proc format; invalue mon(upcase) 'JAN'=1 'FEB'=2 'MAR'=3 'APR'=4 'MAY'=5 'JUN'=6 'JUL'=7 'AUG'=8 'SEP'=9 'OCT'=10 'NOV'=11 'DEC'=12; run; data want; set have; length want $ 20; temp=prxchange('s/unk?//i',-1,date1); x=scan(temp,-1,'/','m'); want=catx('-',want,x); x=scan(temp,-2,'/','m'); want=catx('-',want,put(input(x,mon.),z2.)); x=scan(temp,-3,'/','m'); want=catx('-',want,x); want=translate(want,' ','.'); drop x temp; run;