Assuming that your input data is in the following format:
SLN,MOD,PM,NE,CUSTOMER
32121,GG,1,1,AVAILABLE UPON REQUEST
71403,EN,1,0,JET SUPPORT SERVICE INC.
305173,EN,1,1,"UNKNOWN / COTTONWOOD, LLC / J SUPPORT SERVICE, INC."
PJ0136,PS,0,0,"UNKNOWN / GROUP B-50 INC AA
TC0004 anada CSC Europe
Inglewood Ava"
EB0162,RG,0,0,ATR
The following SAS code will produce required output:
data TEST (drop=_TMP_:);
format SLN $6. MOD $2. PM 8. NE 8. CUSTOMER $82. _TMP_STR $100.;
infile 'input.csv' truncover firstobs=2 dlm=',' dsd lrecl=10000;
input SLN MOD PM NE _TMP_STR @;
_TMP_COUNT=0;
do until(mod(_TMP_COUNT, 2) = 0);
CUSTOMER=catx('0A'x, CUSTOMER, _TMP_STR);
_TMP_COUNT=_TMP_COUNT + countc(_TMP_STR, '"');
if mod(_TMP_COUNT, 2) then do;
input _TMP_STR;
end;
end;
CUSTOMER=dequote(CUSTOMER);
run;
Please note that the value for CUSTOMER column where SLN='PJ0136'
is multiline (Unix style). You can remove this by changing function catx(...)
acordingly.