@Tithi wrote:
Thanks for sharing your codes, I actually couldn't copy paste my earlier code but here is the accurate one.
proc format library=ab cntlout=ab.formats_data; run;
/*Step 2 : export to an .SAV file using the FMTLIB option in the PROC EXPORT procedure (using the formats data set)*/
PROC EXPORT DATA=ab.final_merged OUTFILE="H:\Faculty_Projects\Abigail Batchelder\Datasets\final_merged2.sav" DBMS=SPSS REPLACE; FMTLIB=ab.formats_data; RUN;
The codes you shared created the formats and the data files separately in SPSS; however, my original problem is still there. The formats carry only the labels but not all the values.
If you want to use the FMTLIB= statement in your PROC EXPORT you need to give it the name of the format CATALOG, not the name of DATASET.
So assuming your original PROC FORMAT statement that was using LIB=AB worked then you should be able to use either of these forms in your PROC EXPORT since the default catalog name PROC FORMAT would use when no name is provided is FORMATS.
fmtlib=ab;
fmtlib=ab.formats;
... View more