I know that this is really simplistic and clunky (I never really got out of SASv6 mode!), but perhaps it can start you down a trail. Some of the code is bloated to provide intermediate outputs, and could easily be replaced. The assumption is that column N is the field with multiple commas, and that quotation marks are always omitted. data test; infile "C:\My SAS Files\sample.csv" lrecl=256 pad; length aa a b c d e f g h i j k l m n o p q r s t u v w $12; length ipt ript tipt $256.; input ipt $char256.; ript=trim(reverse(ipt)); array field {*} a b c d e f g h i j k l m n o p q r s t u v w; do ii=dim(field) to 15 by -1; jj=index(ript,","); if jj=1 then do; field(ii)=" "; ript=substr(ript,2); end; else do; field{ii}=reverse(substr(ript,1,jj-1)); ript=trim(substr(ript,jj+1)); end; end; tipt=left(reverse(ript)); do ii=1 to 13; jj=index(tipt,","); if jj=1 then do; field(ii)=" "; tipt=substr(tipt,2); end; else do; field{ii}=substr(tipt,1,jj-1); tipt=trim(substr(tipt,jj+1)); end; end; n=trim(tipt); run;
... View more