全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1770 5
2016-09-29
原始数据是
Alanine  Aminotransferase (IU/L) - CN
Alanine Aminotransferase (U/L) - SI
Albumin (g/L) - SI
Albumin (g/dL) - CN
Alkaline Phosphatase (IU/L) - CN
Alkaline Phosphatase (U/L) - SI
Anisocytes - OTHER
Anti-Smooth Muscle Antibody (ASMA) - OTHER
Antinuclear Antibodies - OTHER
Aspartate Aminotransferase (IU/L) - CN
Aspartate Aminotransferase (U/L) - SI
Basophils (10^3/uL) - CN
Basophils (10^9/L) - SI
Bicarbonate (mEq/L) - CN
Bicarbonate (mmol/L) - SI
Bilirubin (mg/dL) - CN
Bilirubin (umol/L) - SI
Bilirubin - OTHER
Blood Urea Nitrogen (mg/dL) - CN
Blood Urea Nitrogen (mmol/L) - SI
Calcium (mg/dL) - CN
Calcium (mmol/L) - SI
Chloride (mEq/L) - CN
Chloride (mmol/L) - SI
Cholesterol (mg/dL) - CN
Cholesterol (mmol/L) - SI
Choriogonadotropin Beta - OTHER
Clarity - OTHER
Color - OTHER
Creatine Kinase (IU/L) - CN
Creatine Kinase (U/L) - SI
Creatinine (mg/dL) - CN
Creatinine (umol/L) - SI
Direct Bilirubin (mg/dL) - CN
Direct Bilirubin (umol/L) - SI
Elliptocytes - OTHER
Eosinophils (10^3/uL) - CN
Eosinophils (10^9/L) - SI
Ery. Mean Corpuscular HGB Concentration (%) - CN
Ery. Mean Corpuscular HGB Concentration (mmol/L) - SI
Ery. Mean Corpuscular Hemoglobin (fmol) - SI
Ery. Mean Corpuscular Hemoglobin (pg) - CN
Ery. Mean Corpuscular Volume (fL) - CN
Ery. Mean Corpuscular Volume (fL) - SI
Erythrocyte Cell Morphology - OTHER
Erythrocytes (10^12/L) - SI
Erythrocytes (10^6/uL) - CN
Estimated GFR (mL/min/1.73 m^2) based on CG method - OTHER
Estimated GFR (mL/min/1.73 m^2) based on CKD-EPI method - OTHER
Estimated GFR (mL/min/1.73 m^2) based on MDRD method - OTHER
Gamma Glutamyl Transferase (IU/L) - CN
Gamma Glutamyl Transferase (U/L) - SI
Glucose (mg/dL) - CN
Glucose (mmol/L) - SI
Glucose - OTHER
Haptoglobin (g/L) - SI
Haptoglobin (mg/dL) - CN
Hematocrit (%) - CN
Hematocrit (fraction of 1) - SI
Hemoglobin (g/dL) - CN
Hemoglobin (mmol/L) - SI
Hemoglobin A1C (%) - CN
Hemoglobin A1C (mmol/mol) - SI
Hepatitis A Virus Antibody - OTHER
Hepatitis A Virus Antibody IgM - OTHER
Hepatitis B Virus Core Antibody - OTHER
Hepatitis B Virus Surface Antibody - OTHER
Hepatitis B Virus Surface Antigen - OTHER
Hepatitis C Virus Antibody - OTHER
Hepatitis C Virus RNA (IU/mL) - CN
Hepatitis C Virus RNA (IU/mL) - SI
Hepatitis E PCR - OTHER
Hepatitis E Virus IgM Antibody - OTHER
Hepatitis E, IGG - OTHER
High-density Lipoprotein (HDL) Cholesterol (mg/dL) - CN
High-density Lipoprotein (HDL) Cholesterol (mmol/L) - SI
Hypochromia - OTHER
Insulin (pmol/L) - SI
Insulin (uU/mL) - CN
Ketones - OTHER
Lactate Dehydrogenase (IU/L) - CN
Lactate Dehydrogenase (U/L) - SI
Leukocyte Esterase - OTHER
Leukocytes (10^3/uL) - CN
Leukocytes (10^9/L) - SI
Log(Triglycerides) - CN
Log(Triglycerides) - SI
Low-density Lipoprotein (LDL) Cholesterol (Combined) (mg/dL) -  CN
Low-density Lipoprotein (LDL) Cholesterol (Combined) (mmol/L) -  SI
Low-density Lipoprotein (LDL) Cholesterol (Direct) (mg/dL) - CN
Low-density Lipoprotein (LDL) Cholesterol (Direct) (mmol/L) - SI
Low-density Lipoprotein (LDL) Cholesterol (mg/dL) - CN
Low-density Lipoprotein (LDL) Cholesterol (mmol/L) - SI
Lymphocytes (10^3/uL) - CN
Lymphocytes (10^9/L) - SI
Lymphocytes Atypical (10^9/L) - CN
Lymphocytes Atypical (10^9/L) - SI
Macrocytes - OTHER
Magnesium (mg/dL) - CN
Magnesium (mmol/L) - SI
Microcytes - OTHER
Monocytes (10^3/uL) - CN
Monocytes (10^9/L) - SI
Myelocytes (10^9/L) - CN
Myelocytes (10^9/L) - SI
Neutrophilic Metamyelocytes (10^3/uL) - CN
Neutrophilic Metamyelocytes (10^9/L) - SI
Neutrophils, Segmented (10^3/uL) - CN
Neutrophils, Segmented (10^9/L) - SI
Nitrite - OTHER
Occult Blood - OTHER
Phosphate (mg/dL) - CN
Phosphate (mmol/L) - SI
Platelets (10^3/uL) - CN
Platelets (10^9/L) - SI
Poikilocytes - OTHER
Polychromasia - OTHER
Potassium (mEq/L) - CN
Potassium (mmol/L) - SI
Protein (g/L) - SI
Protein (g/dL) - CN
Protein - OTHER
Prothrombin Intl. Normalized Ratio (RATIO) - CN
Prothrombin Intl. Normalized Ratio (RATIO) - SI
Prothrombin Time (sec) - CN
Prothrombin Time (sec) - SI
Sodium (mEq/L) - CN
Sodium (mmol/L) - SI
Specific Gravity - CN
Specific Gravity - SI
Target Cells - OTHER
Triglycerides (mg/dL) - CN
Triglycerides (mmol/L) - SI
Urate (mg/dL) - CN
Urate (umol/L) - SI
Urobilinogen - OTHER
pH - CN
pH - SI
最后希望把尾巴-cn-si-other和单位连同括号一起去掉变成
Alanine  Aminotransferase
Alanine Aminotransferase
Albumin
Albumin
Alkaline Phosphatase
Alkaline Phosphatase
Anisocytes
Anti-Smooth Muscle Antibody
Antinuclear Antibodies
Aspartate Aminotransferase
Aspartate Aminotransferase
Basophils
Basophils
Bicarbonate
Bicarbonate
Bilirubin
Bilirubin
Bilirubin
Blood Urea Nitrogen
Blood Urea Nitrogen
Calcium
Calcium
Chloride
Chloride
Cholesterol
Cholesterol
Choriogonadotropin Beta
Clarity
Color
Creatine Kinase
Creatine Kinase
Creatinine
Creatinine
Direct Bilirubin
Direct Bilirubin
Elliptocytes
Eosinophils
Eosinophils
Ery. Mean Corpuscular HGB Concentration
Ery. Mean Corpuscular HGB Concentration
Ery. Mean Corpuscular Hemoglobin
Ery. Mean Corpuscular Hemoglobin
Ery. Mean Corpuscular Volume
Ery. Mean Corpuscular Volume
Erythrocyte Cell Morphology
Erythrocytes
Erythrocytes
Estimated GFR  based on CG  method
Estimated GFR based on CKD-EPI method
Estimated GFR  based on  MDRD method
Gamma Glutamyl Transferase
Gamma Glutamyl Transferase
Glucose
Glucose
Glucose
Haptoglobin
Haptoglobin
Hematocrit
Hematocrit
Hemoglobin
Hemoglobin
Hemoglobin A1C
Hemoglobin A1C
Hepatitis A Virus Antibody
Hepatitis A Virus Antibody IgM
Hepatitis B Virus Core Antibody
Hepatitis B Virus Surface Antibody
Hepatitis B Virus Surface Antigen
Hepatitis C Virus Antibody
Hepatitis C Virus RNA
Hepatitis C Virus RNA
Hepatitis E PCR
Hepatitis E Virus IgM Antibody
Hepatitis E, IGG
High-density Lipoprotein   Cholesterol
High-density Lipoprotein   Cholesterol
Hypochromia
Insulin
Insulin
Ketones
Lactate Dehydrogenase
Lactate Dehydrogenase
Leukocyte Esterase
Leukocytes
Leukocytes
Log
Log
Low-density Lipoprotein   Cholesterol
Low-density Lipoprotein   Cholesterol
Low-density Lipoprotein   Cholesterol
Low-density Lipoprotein   Cholesterol
Low-density Lipoprotein   Cholesterol
Low-density Lipoprotein   Cholesterol
Lymphocytes
Lymphocytes
Lymphocytes Atypical
Lymphocytes Atypical
Macrocytes
Magnesium
Magnesium
Microcytes
Monocytes
Monocytes
Myelocytes
Myelocytes
Neutrophilic Metamyelocytes
Neutrophilic Metamyelocytes
Neutrophils, Segmented
Neutrophils, Segmented
Nitrite
Occult Blood
Phosphate
Phosphate
Platelets
Platelets
Poikilocytes
Polychromasia
Potassium
Potassium
Protein
Protein
Protein
Prothrombin Intl. Normalized Ratio
Prothrombin Intl. Normalized Ratio
Prothrombin Time
Prothrombin Time
Sodium
Sodium
Specific Gravity
Specific Gravity
Target Cells
Triglycerides
Triglycerides
Urate
Urate
Urobilinogen
pH
pH
这里有几个难点,第一保留的值中也有“-”这个连接符,第二,单位不一定在最后,有的也会在中间!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2016-9-29 12:06:02
data wanted;
set test;
do while(index(test,'('));
par_l=index(test,'(');
par_r=index(test,')');
test=substr(test,1,par_l-1)||substr(test,par_r+1);
end;
dashpos=find(test,'-',-length(test));
if dashpos ne 0 then test=substr(test,1,dashpos-1);
keep test;
run;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-9-29 13:35:32
wwang111 发表于 2016-9-29 12:06
data wanted;
set test;
do while(index(test,'('));
你这里的test既是数据集,又是变量吗?为什么我拿过改了之后运行起来就一直是runing状态?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-9-29 18:30:24
是的,test数据集里的test变量。
如果一直running,我猜测应该是test=substr(test,1,par_l-1)||substr(test,par_r+1);改了,这句等号左右两边的变量名是一样的,要么都是test,要么都是其他,否则,就不会满足do循环结束的条件了,就会一直运行。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-9-30 09:55:33
wwang111 发表于 2016-9-29 18:30
是的,test数据集里的test变量。
如果一直running,我猜测应该是test=substr(test,1,par_l-1)||substr(tes ...
好的!成功了!
但是
dashpos=find(test,'-',-length(test));
if dashpos ne 0 then test=substr(test,1,dashpos-1);
不太理解,这个find是从哪里作为起始位置,是向前还是向后?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-9-30 11:11:30
复制代码
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群