SAS - input, put, variable processing time

   

data sasuser.talent10;
    set sasuser.talent;
    month=month(lasthried);
    where month=10;
run;
/ * SUM arithmetic functions and the like can be directly added instead of numeric type variables, will create the char into a temporary variable num, but not where * / 
   / *   Base2 are looked up = INPUT (testbase,. 4.) - avgbase;
    mean (of a1-a5); when the number of variables * /
   data sasuser.talent2;
   set sasuser.talent;
   FtHeight = INPUT (height, 2 .) / 12 is ;     / * INPUT-digital characters, format with cha itself! ! * / 
Proc Print Data = sasuser.talent2;
run;

/ * Generate cha variables * / 
/ *      A = Sex; Sex itself cha
    a=sex||'/'||age;    concatenate
    a=sex||'/'||put(age,4);
*/

data sasuser.njtalent;
   set sasuser.talent;
   NewPhone='(201)'||put(phone,7.);
run;
proc print data=sasuser.njtalent;
   var id phone newphone;
run;

data sasuser.talent10;
    set sasuser.talent;
    month=month(lasthired);
run;
proc print data=sasuser.talent10;
    where month=10;
run;

data sasuser.talent10;
   set sasuser.talent;
   if month(lasthired)=10;
   .; lasthired date9 the format   / * to a 5-digit date 12FEB2000 such a readable format * /
run;
proc print data=sasuser.talent10;
run;

data sasuser.taloct99;
   set sasuser.talent;
   if year(lasthired)=1999 and month(lasthired)=10;
   format lasthired date9.;
run;
proc print data=sasuser.taloct99;
run;


data sasuser.master;
    set sasuser.talent( OBS=5);
    rephired=mdy(month,day,1998);
    format rephired date9.;
    AA=DATE();
    BB=TODAY();
run;
proc print data=sasuser.master ;
run;


data master;
    set sasuser.master;
    qtrselapsed = intck ( ' QTR ' , rephired, lasthired); / * calculate difference * /
run;
proc print data=master;
run;

/ * To the two parameters, plus 5 months rearwardly, b represents a number 1, m = number 15, e = number 30 * / 
MonthX = intnx ( ' month The ' , ' 01jan95 ' D, . 5 , ' B ' ); / * 12935 (June. 1, 1995) * / 
MonthX = intnx ( ' month The ' , ' 01jan95 ' D, . 5 , ' m ' ); / * 12949 (June 15, 1995) * / 
MonthX = intnx ( ' month The ' , ' 01jan95 'd,5,'e');/*12964  (June 30, 1995)*/

 

Guess you like

Origin www.cnblogs.com/super-yb/p/11830105.html