Thank you Patrick once again for your great help. Your program is amazing. Its working perfectly now.
As I am new comer to SAS, if possible, can you please guide how to insert the same program if I use proc import to pull the input file directly like below. I use it like below but I am missing somewhere.
Thanks once again for your extreme support
proc import datafile="/proj/sastmp/pvdm/01_QC/specialchar.csv"
out=test_output
dbms=csv
replace;
getnames=yes;
guessingrows=32767;
run;
data testing1;
length empid $5 _string $200;
length Comments $80;
set test_output;
array nodes {6} $20. Prod_info Instruct Tab_info product issue Rating;
do while(1);
input _string:$200. @;
if missing(_string) then leave;
_n_nodes=countc(_string,'[');
/* find node with keyword "info" */
do _i=1 to 2*_n_nodes by 2;
if findw(scan(_string,_i,'[]'),'info',' ','i')>0 then
do;
_info_node=(_i+1)/2;
leave;
end;
end;
/* populate node variables */
do _i=1 to 2*_n_nodes by 2;
nodes[(_i+1)/2 + (3-_info_node)]=scan(_string,_i,'[]');
end;
/* populate comments */
comments=substrn(_string,findc(_string,'-')+1);
output;
end;
run;
... View more