We have a comma delimited text file with 150 fields and 100000 records.
Write a SAS program with which we can read only 100th field and send this field into another text file.
Most efficient Program will be appreciated.
If you want to Learn Base SAS and Advance SAS please mail me at creativityofnature@gmail.com.
Now prepare your Base SAS and
Advance SAS Certification Exams with Online Mock tests: http://exam.sankhyana.com
For training related info kindly mail us at info@sankhyana.com
www.sankhyana.com
Write a SAS program with which we can read only 100th field and send this field into another text file.
Most efficient Program will be appreciated.
If you want to Learn Base SAS and Advance SAS please mail me at creativityofnature@gmail.com.
Now prepare your Base SAS and
Advance SAS Certification Exams with Online Mock tests: http://exam.sankhyana.com
For training related info kindly mail us at info@sankhyana.com
www.sankhyana.com
data txt;
ReplyDeleteinfile "path\txt_in.txt" missover dlm=",";
input var1
var2
.
.
.
var150;
run;
data _null_;
file "path\txt_out.txt";
set txt1 (keep=var100);
if _n_=1 then do;
put "var100";
end;
run;
Alex while reading from raw data itself we have to read only 100th , not after converting into SAS data set. Nice Try..
DeleteThis comment has been removed by the author.
ReplyDeletedata txt;
ReplyDeleteinfile 'textfile.txt' dlm=',' _infile_=y;
var100= scan(y,100,',');
file 'path\xyz.txt';
put var100;
run;