摘要:
View Code 1 data trans; 2 input Answer : $5.; 3 Answer = translate(Answer,'ABCDE','12345'); 4 datalines; 5 14325 6 AB123 7 51492 8 ; 9 10 run;11 title "Computing a New Variable";12 proc report data=trans nowd;13 column Answer;14 define Answer / display "Patient Number& 阅读全文
摘要:
title "Demonstrating the Concatenation Functions";data _null_; Length Join Name1–Name4 $ 15; First = 'Ron '; Last = 'Cody '; Join = ':' || First || ':'; Name1 = First || Last; Name2 = cat(First,Last); Name3 = cats(First,Last); Name4 = catx(' ',First, 阅读全文
摘要:
View Code 1 data look_back; 2 input time temperature; 3 Diff_tmp=dif(temperature); 4 datalines; 5 1 60 6 2 62 7 3 65 8 4 70 9 ;10 run;11 proc print data=look_back;12 run; 运行结果 ObstimetemperatureDiff_tmp1160.226223365344705 阅读全文
摘要:
sas文件合并,支持左右连接连接过程 左连接 merge one two; by ID;View Code 1 data one ; 2 input ID Name $ ; 3 datalines; 4 7 Adam 5 1 Smith 6 2 Schneider 7 4 Gregory 8 ; 9 data two;10 input ID category $ time ;11 datalines;12 1 IT 313 2 economy 2 14 4 music 415 ;16 proc sort data=one;17 by ID;18 run;19 proc so... 阅读全文