199101
  Home FAQ Contact Sign in
 
Advanced search
MATCHING GROUPS



more...
POPULAR GROUPS

more...

found 5 articles for 0.302 sec
On May 14, 7:53 am, Fei <joey...@163.com> wrote: > Hi guys: > > I have a variable yyyymm - year and month, which is a numeric > variable, like: > 199101 > 199102 > > I just want year now...I have tried to used "substr", but it returns a > character. I want a numbric value...is there any way? > > Thanks > > Fei data test1; date_var=199901; output; date_var=199102; output; date_var     

Group: comp.softsys.sas · Group Profile · Search for 199101 in comp.softsys.sas
Author: Reeza
Date: May 14, 2007 13:00

There are a number of ways to do this, some more elegant that others. The quick and dirty way would be to divide the variable containing your numeric date string by 100 and use the INT function to obtain the integer portion of the result. Try Year = INT(yyyymm/100); In this example, "yyyymm" is the name of the numeric variable. That should work for you. Others on the list will probably
Show full article (0.67Kb) · Show article thread
sorry that second assignment statement should have been : Year = Input( Substr( Put( Date , 8. -L ) , 1 , 4 ) , 8. ) ; Toby Dunn On the other hand, you have different fingers. ~ LCG The early bird may get the worm, but the second mouse gets the cheese in the trap. ~ LCG What happens if you get scared half to death, twice? ~ LCG From: Fei <joey_qf@163.COM> Reply     

Group: comp.softsys.sas · Group Profile · Search for 199101 in comp.softsys.sas
Author: Andrew H Karp
Date: May 14, 2007 07:09

Well if they arent SAS Data values then you should make them so and fast. SAS Date Value: Year = Year( Date ) ; and if you want to use a proc and have the values grouped by year then simply add : Format Date Year4. ; To your procedure code. If they are true numeric then you will need : Year = Input( Put( Date , 8. -L ) 8. ) ; Toby Dunn On the other hand, you have
Show full article (1.04Kb) · Show article thread
    

Group: comp.softsys.sas · Group Profile · Search for 199101 in comp.softsys.sas
Author: toby dunn
Date: May 14, 2007 06:59

Show full article (0.86Kb)
    

Group: comp.softsys.sas · Group Profile · Search for 199101 in comp.softsys.sas
Author: toby dunn
Date: May 14, 2007 06:57

Show full article (1.12Kb)
    

Group: comp.softsys.sas · Group Profile · Search for 199101 in comp.softsys.sas
Author: Fei
Date: May 14, 2007 06:53

Show full article (0.25Kb)