You cannot use the same format with two different encodings. That is because the bytes used to represent the characters differ depending the encoding you are using. Consider a lower case n with tilde over it. It is 'F1'x in LATIN1 encoding and 'C3B1'x in UTF-8 encoding.
25 data test;
26 enye = 'F1'x ;
27 put enye= enye $hex2. ;
28 utf8 = kcvt(enye,'latin1','utf-8');
29 put utf8= $hex4.;
30 run;
enye=ñ F1
utf8=C3B1
You will probably want to create two different format CATALOGs. (They could be in the same LIBRARY if you want, just use different names for the catalogs.)
proc format lib=mylib.utf8;
value ....
Then just change which one you include in your FMTSEARCH system option based on what encoding your current session is using.
Or you could make two different formats and then decide which format to use based on the encoding.
proc format ;
value latin1f 1='F1'x;
value ut8f 1='C3B1'x ;
run;
... View more