Hi, you can also get a list of "bad" characters in an ERROR data set without resorting to PRX functions (for those of us who have never "gotten the hang of PRX") ... that smiley face in data set WANT is an HTML thing ... * make variable X length 20 to increase the chance of 2+ bad characters; data have; length x $20; do i=1 to 20; x=' '; do j=1 to 20; y = ceil(100*ranuni(99)) + 32; x = catt(x,byte(y)); end; output; end; keep x; run; data error (keep=rec pos character ascii) want(keep=x ok); set have; ok = length(x) eq length(compress(x,collate(128,255))); output want; rec=_n_; start=1; do j=1 to length(x); pos = findc(x,collate(128,255),start); if pos then do; character=char(x,pos); ascii=rank(character); start+pos; output error; end; end; run; the ERROR data set ... Obs rec pos character ascii 1 1 6 € 128 2 1 17 ƒ 131 3 2 14 ƒ 131 4 4 2 „ 132 5 8 8 € 128 6 10 4 € 128 7 10 12 „ 132 8 11 17 „ 132 9 18 10 129 10 19 4 ‚ 130 11 19 8 € 128 12 19 13 ƒ 131 13 20 2 € 128 the WANT data set ... Obs x ok 1 @$[e8€l`}\,wQbkKƒ?fK 0 2 .w>L+brMdA+04ƒFKhn<a 0 3 Q8[U/?{K_yLt(Bzl{+Wy 1 4 h„9Zm0kZ7C_xb+RLpa_k 0 5 4C6Qs&M^#]q3$ypchlqC 1 6 4SrN>?Xspajvr|1_X}fT 1 7 {1|Q}DWQ0i~f]>Yjz7Gm 1 8 86K08O*€g1H/sE6ITbSi 0 9 +b_8J5I?=vO4~vtC3ZPw 1 10 MFr€-CuAeIh„D24xiM}i 0 11 n>n$/_a[|.1oK!78„sMx 0 12 S?m-{2]|&6'i$oI{3#T 1 13 X$4Cq#igu&'*eJIgqLw# 1 14 ]5ewe:ppE3't$}DsII0$ 1 15 U;N=cO*iy}xQ_%uICg^` 1 16 Vw.H\=Y?rI[]u^4g/M)O 1 17 M<pLy)%3wg\?bef`76"^ 1 18 +aJFURsNc_/|HMvDsL 0 19 t1q‚C@S€WCq7ƒK]ƒi3\" 0 20 T€S3sWm">P,!*k1NC08C 0
... View more