Type : CREATION_INTERNE
All data used (test strings) are defined and created directly within the script via macro variables or DATA steps writing to temporary files. No external data or SASHELP is directly read.
| 1 | %let string1=base ik ally; |
| 2 | filename tmp temp; |
| 3 | DATA _null_; |
| 4 | file tmp; |
| 5 | put "&string1"; |
| 6 | RUN; |
| 7 | %mp_base64copy(inref=tmp, outref=myref, ACTION=ENCODE) |
| 8 | |
| 9 | DATA _null_; |
| 10 | INFILE myref; |
| 11 | INPUT; |
| 12 | put _infile_; |
| 13 | RUN; |
| 14 | %mp_base64copy(inref=myref, outref=mynewref, ACTION=DECODE) |
| 15 | DATA _null_; |
| 16 | INFILE mynewref lrecl=5000; |
| 17 | INPUT; |
| 18 | put _infile_; |
| 19 | call symputx('string1_check',_infile_); |
| 20 | stop; |
| 21 | RUN; |
| 22 | %mp_assert( |
| 23 | iftrue=("&string1"="&string1_check"), |
| 24 | desc=Basic String Compare, |
| 25 | outds=work.test_results |
| 26 | ) |
| 1 | filename tmp2 temp lrecl=500; |
| 2 | DATA _null_; |
| 3 | file tmp2; |
| 4 | put "'╤', '╔', '╗', '═', '╧', '╚', '╝', '║', '╟', '─', '┼', '║', '╢', '│'"; |
| 5 | RUN; |
| 6 | %mp_base64copy(inref=tmp2, outref=myref2, ACTION=ENCODE) |
| 7 | |
| 8 | %mp_base64copy(inref=myref2, outref=newref2, ACTION=DECODE) |
| 9 | DATA _null_; |
| 10 | INFILE newref2 lrecl=5000; |
| 11 | INPUT; |
| 12 | list; |
| 13 | /* do not print the string to the log else viya 3.5 throws exception */ |
| 14 | IF trim(_infile_)= |
| 15 | "'╤', '╔', '╗', '═', '╧', '╚', '╝', '║', '╟', '─', '┼', '║', '╢', '│'" |
| 16 | THEN call symputx('check2',1); |
| 17 | ELSE call symputx('check2',0); |
| 18 | stop; |
| 19 | RUN; |
| 20 | %mp_assert( |
| 21 | iftrue=("&check2"="1"), |
| 22 | desc=Double Byte String Compare, |
| 23 | outds=work.test_results |
| 24 | ) |