Hi! I am having some issues with properly reading in the .csv file test_1.csv (see attached). For some reason, when I read it in, the values of the 871st row take the place of the 870th, and the 870th row don't show up as is at all. Here is the code I used to read in the .csv file:
options MSGLEVEL=I;
options validvarname=v7;
proc import out=one
datafile='/home/user/Assessment/test_1.csv'
DBMS=csv replace;
getnames=yes;
run;
Any input regarding what might be going wrong would be much appreciated! Thanks so much!
Per default Proc Import analysis only a portion of the source file to determine the variable type and length.
Add below highlighted statement for proc import to scan the whole source file.
Update:
On inspection of the data it looks like things start to fall apart on line 809. Inspect line 808 and 809 using a text editor like Notepad++. Something must be going on there that causes this issue.
Here what I see using Notepad++
You need to fix your source data.
Given the low volumes and assume this is a one-off task likely best done directly with a text editor.
Try opening your CSV file in a text editor like Notepad++ (don't use Excel). On line 870 look to see if the line is split onto the next line by an embedded line feed. If you can locate exactly where it is you should be able to remove it and save your corrected file.
Per default Proc Import analysis only a portion of the source file to determine the variable type and length.
Add below highlighted statement for proc import to scan the whole source file.
Update:
On inspection of the data it looks like things start to fall apart on line 809. Inspect line 808 and 809 using a text editor like Notepad++. Something must be going on there that causes this issue.
Here what I see using Notepad++
You need to fix your source data.
Given the low volumes and assume this is a one-off task likely best done directly with a text editor.
You need to change some variabels's informat and format by your hand. Check attachment code.
So the file is messed up on that line. That one line has become over 60 lines long.
You probably need to track down the cause of this error and fix it.
You probably should just use a text editor to fix the file and get the lines correct.
If you want to try to use a program to fix the file there are two methods that sometimes work. First is (as has been suggested already) is to remove any end of lines that appear inside quoted strings. That will not work for this file because it does not have quotes around the offending line breaks.
Second is to try and count the number of fields seen so far and remove the line breaks when the line does not have enough fields. That will work for this file (but might not for a file where the end of lines are inserted into the first or last field on a line).
filename csv 'c:\downloads\test_1.csv';
filename csvfix temp;
data _null_;
infile csv end=eof;
file csvfix ;
input ;
headers=countw(_infile_,',','mq');
put _infile_;
nw = 0;
do while(not eof);
input ;
nw + countw(_infile_,',','mq');
put _infile_ @;
if nw >= headers then do;
put;
nw=0;
end;
end;
run;
Now you can read the file using PROC IMPORT. Or better write your own data step to read the file and have full control over how the variables are defined. You could also use the %CSV2DS() macro to guess how to read the file. At least then you will have cleaner dataset and cleaner SAS code.
filename github url 'https://raw.githubusercontent.com/sasutils/macros/master/csv2ds.sas';
%include github;
filename github url 'https://raw.githubusercontent.com/sasutils/macros/master/parmv.sas';
%include github;
%csv2ds(filen=csvfix,out=want,replace=yes);
data want;
infile CSVFIX dlm=',' dsd truncover firstobs=2 ;
length intid_id 8 vdate_id 8 comp_id 8 date_entered 8 del_date 8
del_type 8 gestwk 8 gestday 8 vstatus 8 deathdate 8 revdate 8 dma $4
entd 8 counter 8 intid_enrol 8 vdate_enrol 8 comp_enrol 8
sttime_enrol 8 mat_age 8 totpreg 8 totlive 8 lmp 8 usavail 8 usdate 8
usedd 8 medprg 8 medprg1 8 medprg2 8 medprg3 8 medprgcur 8 medprgtim 8
abx_prg 8 abx_prg1 8 abx_prg2 8 abx_prg3 $1 abx_prgcur 8 abx_prgtim 8
ster_prg 8 ster_prg1 8 ster_prg2 8 ster_prg3 $1 ster_prgcur 8
ster_prgtim 8 tt 8 ttnum 8 ttver 8 anc 8 anc_doc 8 anc_nur 8
anc_para 8 anc_fwv 8 anc_sac 8 anc_ha 8 anc_fwa 8 anc_tba 8
anc_homeo 8 anc_ayur 8 anc_vildoc 8 anc_chw 8 anc_quack 8 anc_other 8
anc_otherc 8 anc_dk 8 mat_sch 8 mat_edu 8 hh_roof 8 hh_roofo $1
hh_wall 8 hh_wallo $1 hh_floor 8 hh_flooro $1 hh_num 8 hh_under5 8
matunder5 8 hh_roomsl 8 hh_latrine 8 hh_latrineo 8 hh_water 8
hh_watero 8 mat_smoke 8 mat_chew 8 muac 8 mat_wt 8 mat_ht 8
swabcol_enrol 8 end_enrol 8 childno 8 intid_del 8 vdate_del 8
comp_del 8 sttime_del 8 labor_hr 8 labor_min 8 rom_hr 8 rom_min 8
laborwater 8 color 8 dis_foul 8 dis_pur 8 uterine_ten 8 medlab 8
abx_lab 8 ster_lab 8 vit_lab 8 medlab_o 8 medlab_dk 8 medlab1 8
medlab2 8 medlab3 8 medlab4 8 swabcol_del 8 noswab_r1 8 noswab_r2 8
noswab_r3 $1 swab_rom 8 swab_vgexam 8 mat_temp 8 mat_temp2 8
mat_temp3 8 mat_hr 8 fetal_hr 8 color_obs 8 dis_foul_obs 8
dis_pur_obs 8 numvag_obs 8 numvag_rep 8 hw_examwash 8 hw_delwash 8
meddel 8 abx_del 8 ster_del 8 meddel_o 8 meddel_dk 8 meddel1 8
meddel2 8 meddel3 8 meddel4 8 meddel_oral 8 meddel_iv 8 meddel_im 8
meddel_unk 8 pushtime $5 deltime $5 cry 8 cry_min 8 cry_sec 8
limbmove 8 limbmove_min 8 limbmove_sec 8 dry_30sec 8 wrap_1min 8
cord_del 8 chlor_del 8 must_del 8 ash_del 8 mud_del 8 cord_delo 8
cord_delo1 $1 cord_delo2 $1 washhand_del 8 matcx 8 matcx_obs 8
matcx_hem 8 matcx_o 8 matcx_o1 8 matcx_o2 8 matcx_med 8 matcx_cs 8
matcx_int 8 matcx_intc 8 matcx_med1 8 matcx_med2 8 matcx_med3 8
matcx_med4 8 neocx 8 neocx_asp 8 neocx_hem 8 neocx_o 8 neocx_oc 8
neocx_suc 8 neocx_bag 8 neocx_med 8 neocx_int 8 neocx_intc 8
neocx_med1 8 neocx_med2 8 neocx_med3 8 neocx_med4 8 bw 8 birth_out 8
staff_present 8 staff_nor1 8 staff_nor2 8 staff_nor3 $1 cs_ind 8
cs_indo 8 plac_col 8 plac_nor1 8 plac_nor2 8 plac_nor3 8 plac_color 8
plac_wt 8 plac_len 8 plac_width 8 plac_ht 8 gas_loc 8 gas_nor 8
facdel 8 facdel_o 8 sbp 8 dbp 8 apgar_1min 8 apgar_5min 8
endtime_del 8 merge2 8 childid 8 dateofenrolment 8
returnedtodeliver $3 delivery $9 sexlog $6 enrolanc 8 babyenrolled $3
note $43 lmplog 8 studyid 8 gest 8 usgest 8 gestage 8 intid_1 8
vdate_1 8 comp_1 8 sex $6 vstatus_1 8 exam_befdis 8 bath_1 8 batht_ 8
bft_ 8 colos 8 feeding_1 8 bf_1 8 bfnum_1 8 prelactal_1 8 prewater_1 8
prehoney_1 8 presugar_1 8 pretea_1 8 premilk_1 8 prejuice_1 8
preexp_1 8 preother_1 8 preotherc_1 8 bottle_1 8 spoon_1 8 dropper_1 8
cloth_1 8 q13x 8 feedother_1 8 prenum_1 8 cord_1 8 chlor_1 8 must_1 8
ash_1 8 mud_1 8 cordother_1 8 cordotherc_1 8 em_1 8 em_must_1 8
em_sun_1 8 em_olive_1 8 em_baby_1 8 em_lotion_1 8 q18x 8 em_other_1 8
mu_feed_1 8 mp_feed_1 8 mu_conv_1 8 mp_conv_1 8 mu_cry_1 8 mp_cry_1 8
mu_fast_1 8 mp_fast_1 8 mu_indraw_1 8 mp_indraw_1 8 mu_hot_1 8
mp_hot_1 8 mu_cold_1 8 mp_cold_1 8 mu_yellow_1 8 mp_yellow_1 8
mu_1other_1 8 m_1other_1 8 mp_1other_1 8 mu_2other_1 8 m_2other_1 8
mp_2other_1 8 mu_3other_1 8 m_3other_1 $1 mp_3other_1 $1 wt_1 8
temp_1 8 tempr_1 8 rr_1 8 rrr_1 8 o2sat_1 8 o_feed_1 8 o_conv_1 8
o_cry_1 8 o_move_1 8 o_flare_1 8 o_indraw_1 8 o_grunt_1 8
o_cynanosis_1 8 o_caprefill_1 8 o_fontanel_1 8 o_pustule_1 8
o_omph_1 8 o_fever_1 8 o_hypo_1 8 o_rr_1 8 o_hypoxic_1 8 sinf_1 8
o_yellow_1 8 o_eye_1 8 q54 8 o_1other_1 8 q55 8 o_2other_1 8 q56 8
o_3other_1 $1 ref_1 8 physig 8 endtime_1 8 sttime 8 sttime_1 8
timevisit_1 8 merge3 8 deltype 8 vagdatecount 8 comp_lm 8 swab_pd 8
vag 8 vag_date_e 8 vag_cx 8 vag_numorg 8 vagorg1 $33 organism1 $33
vagorg2 $33 organism2 $33 vagorg3 $33 organism3 $33 vagcx_gbs 8
vaglat_gbs 8 vag_gbsres 8 pcn_vag 8 amp_vag 8 ceft_vag 8 ceph_vag 8
chlor_vag 8 cot_vag 8 cipro_vag 8 gent_vag 8 net_vag 8 imi_vag 8
eryth_vag 8 azithro_vag 8 rec 8 rec_date 8 reccx_gbs 8 reclat_gbs 8
rec_gbsres 8 pcn_rec 8 amp_rec 8 ceft_rec 8 ceph_rec 8 chlor_rec 8
cot_rec 8 cipro_rec 8 gent_rec 8 net_rec 8 imi_rec 8 eryth_rec 8
azithro_rec 8 plac 8 plac_date 8 plac_cx 8 plac_numorg 8 placorg1 8
placorganism1 $33 placorg2 8 placorganism2 $33 placorg3 8 placcx_gbs 8
placlat_gbs 8 plac_gbsres 8 pcn_plac 8 amp_plac 8 ceft_plac 8
ceph_plac 8 chlor_plac 8 cot_plac 8 cipro_plac 8 gent_plac 8
net_plac 8 imi_plac 8 eryth_plac 8 azithro_plac 8 swabdel 8 swabanc $1
studyid2 8 dif 8 dif2 8 gestagewk 8 gestagedays 8 stage $6 active $3
dob 8 typedel $9 motherenrolled $3 ifbabyisnotenrolledwhynot $50
lbw $8 preterm $11 sexlog1 8 mat_edu01 8 hh_rooms01 $9 hh_num01 $10
memcolor 8 tt1 $3 anc1 $3 anc_doc1 $3 mat_sch1 $3 hhroof $9 hhwall $18
hhfloor $14 hhnum $8 hhunder5 $6 hhlatrine $22 hhwater $8 labortime 8
labor $6 romtime 8 rom $6 rom_d $17 prom $3 uterine $3 amncolor $14
vagexam $3 washex $3 washdel $3 mattemp $4 mathr $5 matage $4
crytime 8 missing $1 score 8 score1 8 wealth 8 wealth_d 8 apgar1c 8
apgar5c 8 cryc 8 crycc 8 limbmovec 8 limbmovecc 8 limbap 8 limborap 8
limb_1min 8 limb_5min 8 cry_1min 8 cry_5min 8 nrd 8 exitformdate 8
exitreasonform $10 exitstudy 8 exitcauseform $12 child 8 intid_2 8
vdate_2 8 comp_2 8 formno_2 8 vstatus_2 8 day2 8 healthprov_2 8
loc_2 8 loco_2 8 dxsepsis_2 8 dxdiarr_2 8 dxuri_2 8 dxnormal_2 8
dxother_2 8 dx1other_2 8 dx2other_2 8 dx3other_2 8 med_2 8 med1_2 8
med2_2 8 med3_2 $1 feeding_2 8 bf_2 8 bfnum_2 8 prelactal_2 8
prewater_2 8 prehoney_2 8 presugar_2 8 pretea_2 8 premilk_2 8
prejuice_2 8 preexp_2 8 preo_2 8 preoc_2 8 bottle_2 8 spoon_2 8
dropper_2 8 cloth_2 8 instro_2 8 instroc_2 8 prenum_2 8 cord_2 8
chlor_2 8 must_2 8 ash_2 8 mud_2 8 cordother_2 8 cordotherc_2 8 em_2 8
em_must_2 8 em_sun_2 8 em_olive_2 8 em_baby_2 8 em_lotion_2 8 Q19x2 8
em_other_2 8 iso_2 8 wash_2 8 sick_2 8 sicknum_2 8 sicktouch_2 8
sicktouchnum_2 8 mu_feed_2 8 mp_feed_2 8 mu_conv_2 8 mp_conv_2 8
mu_cry_2 8 mp_cry_2 8 mu_fast_2 8 mp_fast_2 8 mu_indraw_2 8
mp_indraw_2 8 mu_hot_2 8 mp_hot_2 8 mu_cold_2 8 mp_cold_2 8 sinfm_2 8
mu_yellow_2 8 mp_yellow_2 8 mu_diar_2 8 mp_diar_2 8 mu_eye_2 8
mp_eye_2 8 mu_1other_2 8 m_1other_2 8 mp_1other_2 8 mu_2other_2 8
m_2other_2 8 mp_2other_2 8 mu_3other_2 8 m_3other_2 $1 mp_3other_2 $1
refacp_2 8 ref_2 $1 endtime_2 8 sttime2 8 sttime_2 8 timevisit_2 8
counter2 8 intid_3 8 vdate_3 8 comp_3 8 formno_3 8 vstatus_3 8 day3 8
healthprov_3 8 loc_3 8 loco_3 8 dxsepsis_3 8 dxdiarr_3 8 dxuri_3 8
dxnormal_3 8 dxother_3 8 dx1other_3 8 dx2other_3 8 dx3other_3 8
med_3 8 med1_3 8 med2_3 8 med3_3 8 feeding_3 8 bf_3 8 bfnum_3 8
prelactal_3 8 prewater_3 8 prehoney_3 8 presugar_3 8 pretea_3 8
premilk_3 8 prejuice_3 8 preexp_3 8 preo_3 8 preoc_3 8 bottle_3 8
spoon_3 8 dropper_3 8 cloth_3 8 instro_3 8 instroc_3 8 prenum_3 8
cord_3 8 chlor_3 8 must_3 8 ash_3 8 mud_3 8 cordother_3 8
cordotherc_3 8 em_3 8 em_must_3 8 em_sun_3 8 em_olive_3 8 em_baby_3 8
em_lotion_3 8 Q19x3 8 em_other_3 8 iso_3 8 wash_3 8 sick_3 8
sicknum_3 8 sicktouch_3 8 sicktouchnum_3 8 mu_feed_3 8 mp_feed_3 8
mu_conv_3 8 mp_conv_3 8 mu_cry_3 8 mp_cry_3 8 mu_fast_3 8 mp_fast_3 8
mu_indraw_3 8 mp_indraw_3 8 mu_hot_3 8 mp_hot_3 8 mu_cold_3 8
mp_cold_3 8 sinfm_3 8 mu_yellow_3 8 mp_yellow_3 8 mu_diar_3 8
mp_diar_3 8 mu_eye_3 8 mp_eye_3 8 mu_1other_3 8 m_1other_3 8
mp_1other_3 8 mu_2other_3 8 m_2other_3 8 mp_2other_3 8 mu_3other_3 8
m_3other_3 $1 mp_3other_3 $1 refacp_3 8 wt_3 8 temp_3 8 tempr_3 8
rr_3 8 rrr_3 8 washc_3 8 o_feed_3 8 o_conv_3 8 o_cry_3 8 o_move_3 8
o_flare_3 8 o_indraw_3 8 o_grunt_3 8 o_cynanosis_3 8 o_caprefill_3 8
o_fontanel_3 8 o_pustule_3 8 o_omph_3 8 o_fever_3 8 o_hypo_3 8
o_rr_3 8 sinf_3 8 o_yellow_3 8 o_eye_3 8 q623 8 o_1other_3 8 q633 8
o_2other_3 8 q643 8 o_3other_3 8 ref_3 8 endtime_3 8 sttime3 8
sttime_3 8 timevisit_3 8 counter3 8 intid_4 8 vdate_4 8 comp_4 8
formno_4 8 vstatus_4 8 day4 8 healthprov_4 8 loc_4 8 loco_4 8
dxsepsis_4 8 dxdiarr_4 8 dxuri_4 8 dxnormal_4 8 dxother_4 8
dx1other_4 8 dx2other_4 8 dx3other_4 8 med_4 8 med1_4 8 med2_4 8
med3_4 8 feeding_4 8 bf_4 8 bfnum_4 8 prelactal_4 8 prewater_4 8
prehoney_4 8 presugar_4 8 pretea_4 8 premilk_4 8 prejuice_4 8
preexp_4 8 preo_4 8 preoc_4 8 bottle_4 8 spoon_4 8 dropper_4 8
cloth_4 8 instro_4 8 instroc_4 $1 prenum_4 8 cord_4 8 chlor_4 8
must_4 8 ash_4 8 mud_4 8 cordother_4 8 cordotherc_4 8 em_4 8
em_must_4 8 em_sun_4 8 em_olive_4 8 em_baby_4 8 em_lotion_4 8 Q19x4 8
em_other_4 8 iso_4 8 wash_4 8 sick_4 8 sicknum_4 8 sicktouch_4 8
sicktouchnum_4 8 mu_feed_4 8 mp_feed_4 8 mu_conv_4 8 mp_conv_4 8
mu_cry_4 8 mp_cry_4 8 mu_fast_4 8 mp_fast_4 8 mu_indraw_4 8
mp_indraw_4 8 mu_hot_4 8 mp_hot_4 8 mu_cold_4 8 mp_cold_4 8 sinfm_4 8
mu_yellow_4 8 mp_yellow_4 8 mu_diar_4 8 mp_diar_4 8 mu_eye_4 8
mp_eye_4 8 mu_1other_4 8 m_1other_4 8 mp_1other_4 8 mu_2other_4 8
m_2other_4 8 mp_2other_4 8 mu_3other_4 8 m_3other_4 $1 mp_3other_4 $1
refacp_4 8 ref_4 $1 endtime_4 8 sttime4 8 sttime_4 8 timevisit_4 8
counter4 8 intid_5 8 vdate_5 8 comp_5 8 formno_5 8 vstatus_5 8 day5 8
healthprov_5 8 loc_5 8 loco_5 8 dxsepsis_5 8 dxdiarr_5 8 dxuri_5 8
dxnormal_5 8 dxother_5 8 dx1other_5 8 dx2other_5 8 dx3other_5 8
med_5 8 med1_5 8 med2_5 8 med3_5 8 feeding_5 8 bf_5 8 bfnum_5 8
prelactal_5 8 prewater_5 8 prehoney_5 8 presugar_5 8 pretea_5 8
premilk_5 8 prejuice_5 8 preexp_5 8 preo_5 8 preoc_5 8 bottle_5 8
spoon_5 8 dropper_5 8 cloth_5 8 instro_5 8 instroc_5 8 prenum_5 8
cord_5 8 chlor_5 8 must_5 8 ash_5 8 mud_5 8 cordother_5 8
cordotherc_5 8 em_5 8 em_must_5 8 em_sun_5 8 em_olive_5 8 em_baby_5 8
em_lotion_5 8 Q19x5 8 em_other_5 8 iso_5 8 wash_5 8 sick_5 8
sicknum_5 8 sicktouch_5 8 sicktouchnum_5 8 mu_feed_5 8 mp_feed_5 8
mu_conv_5 8 mp_conv_5 8 mu_cry_5 8 mp_cry_5 8 mu_fast_5 8 mp_fast_5 8
mu_indraw_5 8 mp_indraw_5 8 mu_hot_5 8 mp_hot_5 8 mu_cold_5 8
mp_cold_5 8 sinfm_5 8 mu_yellow_5 8 mp_yellow_5 8 mu_diar_5 8
mp_diar_5 8 mu_eye_5 8 mp_eye_5 8 mu_1other_5 8 m_1other_5 8
mp_1other_5 8 mu_2other_5 8 m_2other_5 8 mp_2other_5 8 mu_3other_5 8
m_3other_5 8 mp_3other_5 8 refacp_5 8 ref_5 $1 endtime_5 8 sttime5 8
sttime_5 8 timevisit_5 8 counter5 8 intid_6 8 vdate_6 8 comp_6 8
formno_6 8 vstatus_6 8 day6 8 healthprov_6 8 loc_6 8 loco_6 8
dxsepsis_6 8 dxdiarr_6 8 dxuri_6 8 dxnormal_6 8 dxother_6 8
dx1other_6 8 dx2other_6 8 dx3other_6 8 med_6 8 med1_6 8 med2_6 8
med3_6 8 feeding_6 8 bf_6 8 bfnum_6 8 prelactal_6 8 prewater_6 8
prehoney_6 8 presugar_6 8 pretea_6 8 premilk_6 8 prejuice_6 8
preexp_6 8 preo_6 8 preoc_6 8 bottle_6 8 spoon_6 8 dropper_6 8
cloth_6 8 instro_6 8 instroc_6 $1 prenum_6 8 cord_6 8 chlor_6 8
must_6 8 ash_6 8 mud_6 8 cordother_6 8 cordotherc_6 8 em_6 8
em_must_6 8 em_sun_6 8 em_olive_6 8 em_baby_6 8 em_lotion_6 8 Q19x6 8
em_other_6 8 iso_6 8 wash_6 8 sick_6 8 sicknum_6 8 sicktouch_6 8
sicktouchnum_6 8 mu_feed_6 8 mp_feed_6 8 mu_conv_6 8 mp_conv_6 8
mu_cry_6 8 mp_cry_6 8 mu_fast_6 8 mp_fast_6 8 mu_indraw_6 8
mp_indraw_6 8 mu_hot_6 8 mp_hot_6 8 mu_cold_6 8 mp_cold_6 8 sinfm_6 8
mu_yellow_6 8 mp_yellow_6 8 mu_diar_6 8 mp_diar_6 8 mu_eye_6 8
mp_eye_6 8 mu_1other_6 8 m_1other_6 8 mp_1other_6 8 mu_2other_6 8
m_2other_6 8 mp_2other_6 8 mu_3other_6 8 m_3other_6 $1 mp_3other_6 $1
refacp_6 8 ref_6 $1 endtime_6 8 sttime6 8 sttime_6 8 timevisit_6 8
counter6 8 intid_7 8 vdate_7 8 comp_7 8 formno_7 8 vstatus_7 8 day7 8
healthprov_7 8 loc_7 8 loco_7 8 dxsepsis_7 8 dxdiarr_7 8 dxuri_7 8
dxnormal_7 8 dxother_7 8 dx1other_7 8 dx2other_7 8 dx3other_7 8
med_7 8 med1_7 8 med2_7 8 med3_7 8 feeding_7 8 bf_7 8 bfnum_7 8
prelactal_7 8 prewater_7 8 prehoney_7 8 presugar_7 8 pretea_7 8
premilk_7 8 prejuice_7 8 preexp_7 8 preo_7 8 preoc_7 8 bottle_7 8
spoon_7 8 dropper_7 8 cloth_7 8 instro_7 8 instroc_7 $1 prenum_7 8
cord_7 8 chlor_7 8 must_7 8 ash_7 8 mud_7 8 cordother_7 8
cordotherc_7 8 em_7 8 em_must_7 8 em_sun_7 8 em_olive_7 8 em_baby_7 8
em_lotion_7 8 Q19x7 8 em_other_7 8 iso_7 8 wash_7 8 sick_7 8
sicknum_7 8 sicktouch_7 8 sicktouchnum_7 8 mu_feed_7 8 mp_feed_7 8
mu_conv_7 8 mp_conv_7 8 mu_cry_7 8 mp_cry_7 8 mu_fast_7 8 mp_fast_7 8
mu_indraw_7 8 mp_indraw_7 8 mu_hot_7 8 mp_hot_7 8 mu_cold_7 8
mp_cold_7 8 sinfm_7 8 mu_yellow_7 8 mp_yellow_7 8 mu_diar_7 8
mp_diar_7 8 mu_eye_7 8 mp_eye_7 8 mu_1other_7 8 m_1other_7 8
mp_1other_7 8 mu_2other_7 8 m_2other_7 8 mp_2other_7 8 mu_3other_7 8
m_3other_7 $1 mp_3other_7 $1 refacp_7 8 wt_7 8 temp_7 8 tempr_7 8
rr_7 8 rrr_7 8 washc_7 8 o_feed_7 8 o_conv_7 8 o_cry_7 8 o_move_7 8
o_flare_7 8 o_indraw_7 8 o_grunt_7 8 o_cynanosis_7 8 o_caprefill_7 8
o_fontanel_7 8 o_pustule_7 8 o_omph_7 8 o_fever_7 8 o_hypo_7 8
o_rr_7 8 sinf_7 8 o_yellow_7 8 o_eye_7 8 q627 8 o_1other_7 8 q637 8
o_2other_7 8 q647 8 o_3other_7 $1 ref_7 8 endtime_7 8 sttime7 8
sttime_7 8 timevisit_7 8 counter7 8 childid2 8 numforms 8 n_days 8
merge45 8 intid_s 8 raid_s 8 vdate_s 8 comp_s 8 sttime_s 8 vstatus_s 8
refsource_s 8 loc_s 8 loco_s $1 med_s 8 med1_s 8 med2_s 8 med3_s 8
feeding_s 8 bf_s 8 bfnum_s 8 prelactal_s 8 prewater_s 8 prehoney_s 8
presugar_s 8 pretea_s 8 premilk_s 8 prejuice_s 8 preexp_s 8 preo_s 8
preoc_s 8 bottle_s 8 spoon_s 8 dropper_s 8 cloth_s 8 instro_s 8
instroc_s 8 prenum_s 8 cord_s 8 chlor_s 8 must_s 8 ash_s 8 mud_s 8
cordother_s 8 cordotherc_s 8 em_s 8 em_must_s 8 em_sun_s 8
em_olive_s 8 em_baby_s 8 em_lotion_s 8 q17x 8 em_other_s 8 iso_s 8
wash_s 8 sick_s 8 sicknum_s 8 sicktouch_s 8 sicktouchnum_s 8
mu_feed_s 8 mp_feed_s 8 mu_conv_s 8 mp_conv_s 8 mu_cry_s 8 mp_cry_s 8
mu_fast_s 8 mp_fast_s 8 mu_indraw_s 8 mp_indraw_s 8 mu_hot_s 8
mp_hot_s 8 mu_cold_s 8 mp_cold_s 8 mu_yellow_s 8 mp_yellow_s 8
mu_diar_s 8 mp_diar_s 8 mu_eye_s 8 mp_eye_s 8 mu_1other_s 8
m_1other_s 8 mp_1other_s 8 mu_2other_s 8 m_2other_s 8 mp_2other_s 8
mu_3other_s 8 m_3other_s $1 mp_3other_s $1 wt_s 8 temp_s 8 tempr_s 8
rr_s 8 rrr_s 8 o2sat_s 8 o_feed_s 8 o_conv_s 8 o_cry_s 8 o_move_s 8
o_flare_s 8 o_indraw_s 8 o_grunt_s 8 o_cynanosis_s 8 o_caprefill_s 8
o_fontanel_s 8 o_pustule_s 8 o_omph_s 8 o_fever_s 8 o_hypo_s 8
o_rr_s 8 o_hypoxic_s 8 sinf_s 8 o_yellow_s 8 o_eye_s 8 q61 8
o_1other_s 8 q62 8 o_2other_s 8 q63 8 o_3other_s $1 bcx_s 8 bcxabx_s 8
cbc_s 8 endtime_s 8 count 8 dateofvisit 8 referedby $15 outcome $52
form6completed $3 listdangersignspresent $50 othertext $1 merge6 8
intid_a1 8 vdate_a1 8 comp_a1 8 sttime_a1 8 vstatus_a1 8 hosp_a1 8
hospo_a1 8 respmom_a1 8 respdad_a1 8 respmgm_a1 8 resppgm_a1 8
respo_a1 8 respoc_a1 8 dmdate_a1 8 refsource_a1 8 feed_a1 8 conv_a1 8
cry_a1 8 move_a1 8 flare_a1 8 indraw_a1 8 grunt_a1 8 cynanosis_a1 8
caprefill_a1 8 fontanel_a1 8 pustule_a1 8 omph_a1 8 fever_a1 8
hypo_a1 8 rr_a1 8 hypoxic_a1 8 q6x1 8 cc_a1 8 q6y1 8 cc2_a1 $1
dxsepsis_a1 8 dxdiarr_a1 8 dxuri_a1 8 dxother_a1 8 dxotherc_a1 8
blood_a1 8 med_a1 8 med1_a1 8 med2_a1 8 med3_a1 8 outcome_a1 8 fu_a1 8
fucall_a1 8 fuama_a1 $1 fudeaht_a1 $1 endtime_a1 8 intid_a2 8
vdate_a2 8 comp_a2 8 vdate_a3 8 comp_a3 8 vdate_a4 8 comp_a4 8
vdate_a5 8 comp_a5 8 vdate_a6 8 comp_a6 8 vdate_a7 8 comp_a7 8
vdate_a8 8 comp_a8 8 vdate_a9 8 comp_a9 8 sttime_a9 8 vstatus_a9 8
hosp_a9 8 hospo_a9 $1 respmom_a9 8 respdad_a9 8 respmgm_a9 8
resppgm_a9 8 respo_a9 8 respoc_a9 $1 dmdate_a9 $1 refsource_a9 $1
feed_a9 $1 conv_a9 $1 cry_a9 $1 move_a9 $1 flare_a9 $1 indraw_a9 $1
grunt_a9 $1 cynanosis_a9 $1 caprefill_a9 $1 fontanel_a9 $1
pustule_a9 $1 omph_a9 $1 fever_a9 $1 hypo_a9 $1 rr_a9 $1 hypoxic_a9 $1
q6x9 $1 cc_a9 $1 q6y9 $1 cc2_a9 $1 dxsepsis_a9 $1 dxdiarr_a9 $1
dxuri_a9 $1 dxother_a9 $1 dxotherc_a9 $1 blood_a9 8 med_a9 8 med1_a9 8
med2_a9 8 med3_a9 $1 outcome_a9 8 fu_a9 8 fucall_a9 8 fuama_a9 $1
fudeaht_a9 $1 endtime_a9 8 intid_a10 8 vdate_a10 8 comp_a10 8 merge7 8
intid_d 8 sttime_d 8 vdate_d 8 comp_d 8 admdate_d 8 disdate_d 8
vstatus_d 8 hosp_d 8 hospo_d 8 dxsepsis_d 8 dxdiarr_d 8 dxuri_d 8
dxother_d 8 dxotherc_d 8 blood_d 8 bcx_staph 8 bcx_strep 8 bcx_ecoli 8
bcx_kleb 8 bcx_other 8 bcx_d 8 bcxabx_d 8 cbc_d 8 wbc_d 8 neut_d 8
bands_d 8 outcome_d 8 outcomeo_d 8 endtime_d 8 merge8 8 merge12 8
comp_c 8 intid_c 8 coderid_c 8 cord_date 8 cord_time 8 cord_temp 8
cord_ph 8 cord_co2 8 cord_po2 8 plusminus 8 lac 8 id $6 date 8
paramedic $7 ven_ph 8 ven_pco2 8 lac1 8 var10 $243 dup 8 id2 8 be 8
art_ph 8 art_pco2 8 be1 8 merge11 8 _tstartingattime0birth 8
reasonforexitinglog $14 descriptionofexit $83 examdateifchwdx 8
modescription $50 chwdescription $79 deathlog $4
hospitalphysiciandescription $244 vitalstatus $24 followupcompleted $3
ifnoreason $17 exittimelog 8 day28 8 chwexam 8 deathtimelog 8
timetoeventlog 8 mergelog 8 single $33 saureus $10 nongbsstrep $14
gbs $6 gbsall $9 ecoli $8 kpneumo $10 staph $8 pseudo $9
actinobacter $15 proteus $10 single_d 8 col $33 col_d 8 colvr $33
colvr_d $15 cocolonized $14 singlevr $33 singlevr_d 8 deltaid $11
mr_stage $4 mr_grade $6 fr_stage $4 fr_grade $6 response $7
incomplete $40 dropcs $1 droprefcs $1 droprefnvd 8 dropreflost $1
dropleft $1 drophomenvd 8 _merge $15 cord 8 ph71 8 nrdpi 8 ph7 8
nrdi 8 nulpar 8 apgar1 8 apgar5 8 facdel_d 8 matht 8 matbmi 8
group_muac 8 muac_d 8 group_mat_wt 8 matwt_c 8 matwt_d 8 group_matht 8
matht_d 8 group_matbmi 8 matbmi_c 8 matbmi_d 8 group_bw 8
group_labortime 8 feed 8 conv 8 move 8 rr 8 indraw 8 fever 8 hypo 8
crym 8
;
informat vdate_id date. date_entered date. del_date date.
deathdate date. revdate date. entd date. vdate_enrol date.
sttime_enrol time. lmp date. usdate date. usedd date. end_enrol time.
vdate_del date. sttime_del time. endtime_del time.
dateofenrolment date. lmplog mmddyy. vdate_1 mmddyy. batht_ time.
bft_ time. endtime_1 time. sttime time. sttime_1 time.
timevisit_1 anydtdtm. vag_date_e date. rec_date date. plac_date date.
dob date. exitformdate date. vdate_2 mmddyy. endtime_2 time.
sttime2 time. sttime_2 time. timevisit_2 anydtdtm. vdate_3 mmddyy.
endtime_3 time. sttime3 time. sttime_3 time. timevisit_3 anydtdtm.
vdate_4 mmddyy. endtime_4 time. sttime4 time. sttime_4 time.
timevisit_4 anydtdtm. vdate_5 mmddyy. endtime_5 time. sttime5 time.
sttime_5 time. timevisit_5 anydtdtm. vdate_6 mmddyy. endtime_6 time.
sttime6 time. sttime_6 time. timevisit_6 anydtdtm. vdate_7 mmddyy.
endtime_7 time. sttime7 time. sttime_7 time. timevisit_7 anydtdtm.
vdate_s date. sttime_s time. endtime_s time. dateofvisit mmddyy.
vdate_a1 date. sttime_a1 time. dmdate_a1 date. endtime_a1 time.
vdate_a2 date. vdate_a3 date. vdate_a4 date. vdate_a5 date.
vdate_a6 date. vdate_a7 date. vdate_a8 date. vdate_a9 date.
sttime_a9 time. endtime_a9 time. vdate_a10 date. sttime_d time.
vdate_d date. admdate_d date. disdate_d date. endtime_d time.
cord_date datetime. cord_time time. date date.
examdateifchwdx anydtdtm. exittimelog date. day28 date. chwexam date.
deathtimelog date.
;
format vdate_id date9. date_entered date9. del_date date9.
deathdate date9. revdate date9. entd date9. vdate_enrol date9.
sttime_enrol time5. lmp date9. usdate date9. usedd date9. muac best17.
mat_wt best17. end_enrol time5. vdate_del date9. sttime_del time5.
mat_temp best17. plac_len best17. plac_width best17. plac_ht best17.
endtime_del time5. dateofenrolment date9. lmplog mmddyy10.
vdate_1 mmddyy10. batht_ time5. bft_ time5. temp_1 best17.
tempr_1 best17. endtime_1 time5. sttime time5. sttime_1 time5.
timevisit_1 datetime19. vag_date_e date9. rec_date date9.
plac_date date9. dob date9. exitformdate date9. vdate_2 mmddyy10.
endtime_2 time5. sttime2 time5. sttime_2 time5.
timevisit_2 datetime19. vdate_3 mmddyy10. temp_3 best17.
tempr_3 best17. endtime_3 time5. sttime3 time5. sttime_3 time5.
timevisit_3 datetime19. vdate_4 mmddyy10. endtime_4 time5.
sttime4 time5. sttime_4 time5. timevisit_4 datetime19.
vdate_5 mmddyy10. endtime_5 time5. sttime5 time5. sttime_5 time5.
timevisit_5 datetime19. vdate_6 mmddyy10. endtime_6 time5.
sttime6 time5. sttime_6 time5. timevisit_6 datetime19.
vdate_7 mmddyy10. temp_7 best17. tempr_7 best17. endtime_7 time5.
sttime7 time5. sttime_7 time5. timevisit_7 datetime19. vdate_s date9.
sttime_s time5. temp_s best17. tempr_s best17. endtime_s time5.
dateofvisit mmddyy10. vdate_a1 date9. sttime_a1 time5.
dmdate_a1 date9. endtime_a1 time5. vdate_a2 date9. vdate_a3 date9.
vdate_a4 date9. vdate_a5 date9. vdate_a6 date9. vdate_a7 date9.
vdate_a8 date9. vdate_a9 date9. sttime_a9 time5. endtime_a9 time5.
vdate_a10 date9. sttime_d time5. vdate_d date9. admdate_d date9.
disdate_d date9. endtime_d time5. cord_date datetime19.
cord_time time5. cord_ph best17. cord_co2 best17. lac best17.
date date9. lac1 best17. art_ph best17. art_pco2 best17.
examdateifchwdx datetime19. exittimelog date9. day28 date9.
chwexam date9. deathtimelog date9.
;
input intid_id -- crym ;
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.