Hi @promo_at_work
I was so interested in learning this _infile_ trick, I stayed up researching and trying to resolve it myself, and here is what I found
According to Reading Long Instream Data Records,
It says "To ensure that your data is processed correctly, use an external file for input when record lengths are greater than 80 bytes."
That's why @Tom's original solution didn't work for you, Due to using cards/datalines, the _infile_ value was truncated down to 80 chars/bytes, instead of the original value of the row variable.
Below is a hybrid of both @Tom's & @FreelanceReinhard solutions, and it looks like this
/* Dummy File */
filename tmpf temp;
/* Ensure it gets created */
data _null_;
file tmpf;
put;
run;
/* Use External file with the _infile_ trick */
Data split;
set test;
array var{700} $10;
Infile tmpf DSD DLM = '|' truncover ls=7699 lrecl=7699;
Input @1 @@;
_infile_ = strip(row) ;
Input @1 var[*] :$10. @@;
drop row;
Run;
It kinda looks like @s_lassen's solution, but I wanted to explain why, and what was needed to get it working.
I hope this was an interesting learning experience for you, as much as it was for me.
Regards,
Ahmed
... View more