在它已经“导入”后你可以做的不多。但是,如果您的源文件只是一个文本文件,那么读取它的数据步骤可以在读取数据的同一步骤中跳过前缀。
data want; infile 'myfile.csv' dsd truncover ; input test :$20. @1 @; do while (test ne 'BEGINDATA'); input ; input test :$20. @1 @; end; * Code to read the actual data lines ; run;
当然!看这个例子。
/* Generate example data */ data have; do i = 1 to 10000; if(i = 100) then description = 'BEGINDATA'; else call missing(description); value = rand('uniform'); output; end; drop i; run; /* Get row where the data begins. Only keep the description variable to reduce the size of the PDV */ data _null_; set have(keep=description); if(description = 'BEGINDATA') then do; call symputx('startrow', _N_, 'G'); stop; end; run; /* Read from the data start row */ data want; set have(firstobs=&startrow.); run;