In reply to Stephen Foerster.

Hi Stephen, Thanks for the reply. I have successfully created my user defined format on CAS, but I can't use it on my VA report after formatted my table on CAS. Here is the error when I import the CAS table on VA report. Not sure why I can't use it on my VA report.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
com.sas.cas.CASException: The user-defined programming statements could not be parsed. (severity=2 reason=6 statusCode=2710055)
4 WARNING: License for feature 'TKCAS SAS Cloud Analytic Services Server' has expired and will stop working in 11 days. Contact your installation representative to obtain a renewal.
4 WARNING: License for feature 'SAGEMID SAS Visual Analytics Explorer' has expired and will stop working in 11 days. Contact your installation representative to obtain a renewal.
3 NOTE: Executing action 'simple.distinct'.
5 ERROR: The user-defined programming statements could not be parsed.
5 ERROR: Invalid FORMAT '$BRANCH_ID_F.' found.
5 ERROR: Failure opening table 'B130082_OP_ORDER'
5 ERROR: The action stopped due to errors.
3 NOTE: Action 'simple.distinct' used (Total process time):
3 NOTE: real time 0.000073 seconds
3 NOTE: cpu time 0.086105 seconds (117952.05%)
3 NOTE: total nodes 1 (8 cores)
3 NOTE: total memory 117.88G
3 NOTE: memory 0.00K (0.00%)
debug=0x887ff837:TKCASTAB_PARSE_ERROR:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Here is the sas code i used on SAS studio

LIBNAME T cvp "/OA_share_folder";

CAS mySession SESSOPTS=(messagelevel=all CASLIB=public TIMEOUT=999 LOCALE="en_US");
CASLIB _ALL_ ASSIGN;

proc format library=work.formats sessRef=mySession casFmtLib="SASFORMATS2";
value $Branch_id_f
"1"="A"
"2"="B"
"3"="C"
"4"="D"
"5"="E"
"6"="F"
;

run;

cas mySession promoteFmtLib fmtLibName=SASFORMATS2 replace ;

cas mySession saveFmtLib fmtLibName=SASFORMATS2 casLib=Formats
table=SASFORMATS2 replace;

data test ;
set t.B130082_OP_ORDER;
format Branch_id $Branch_id_f. func_type $func_type_f. Hosp_cnt_type $Hosp_cnt_type_f. Hosp_data_type $Hosp_data_type_f.;
run;

proc casutil;
load data=test outcaslib="public" casout="B130082_OP_ORDER_stg"
replace;
quit;

PROC CASUTIL;
droptable casdata="B130082_OP_ORDER" incaslib="public";
promote casdata="B130082_OP_ORDER_stg" casout="B130082_OP_ORDER" incaslib="public"
outcaslib="public" ;
quit;