/* Missing value in the middle of a record interpret ,, as one delimiter */ data credit; infile datalines dlm=','; *use infile statement with the datalines option; input sex $ age bcard fbcard dcard fdcard; datalines; male,,1,4,0,2 female,30,2,3,4,2 female,40,1,4,1,2 male,70,5,3,1,2 ; run; proc print data =credit;run; /* since the default delimiter is comma no need to specify DLM option */ data credit; infile datalines dsd; *use infile statement with the datalines option; input sex $ age bcard fbcard dcard fdcard name; datalines; male,,1,4,0,2 female,30,2,3,4,2 female,40,1,4,1,2 male,70,5,3,1,2 ; run; proc print data =credit;run; /* use DLM option first value of the obs is missing */ data credit; infile datalines dsd dlm='*'; input sex $ age bcard fbcard dcard fdcard; datalines; *32*1*4*0*2 female*30*2*4*2*3 female*40*1*4*1*2 male*70*5*3*1*2 ; run; proc print data =credit;run; /* new variable: city use LENGTH stmt and & modifier: read until two consecutive blanks OR can use an informat $w. */ data credit; length city $12; infile datalines dsd dlm='*'; input sex $ age bcard fbcard dcard fdcard city & ; *input sex $ age bcard fbcard dcard fdcard city & $12.; datalines; *32*1*4*0*2*los angels female*30*2*4*2*3*chicago female*40*1*4*1*2*philadelphia male*70*5*3*1*2*san antonio ; run; proc print data =credit;run; /* new variable: income : modifier to read non-standard income data until a delimiter or blank (and character values longer than 8 chars) */ data credit; length city $12; infile datalines dsd dlm='*'; input sex $ age bcard fbcard dcard fdcard city: income : comma.; *list input reads until next blank-comma. works; *input sex $ age bcard fbcard dcard fdcard city:$12. income : comma10.2; datalines; *32*1*4*0*2*los angels*37,283.21 female*30*2*4*2*3*chicago* female*40*1*4*1*2*philadelphia*102,253.93 male*70*5*3*1*2*san antonio*87,287.23 ; run; proc print data =credit;run;