Hi, I've got a dataset with around 5000 variables, that need formats assigned. I have two sas programs. The first one is defining the formats and saving them into a SAS catalog file:
LIBNAME dataset 'path';
proc format library=dataset;
/* Wave 1 formats */
value STATEID /* State/Territory */
1 = 'ACT'
2 = 'NSW'
3 = 'VIC'
4 = 'QLD'
5 = 'SA'
6 = 'WA'
7 = 'TAS'
8 = 'NT' ;
value SECTOR /* School sector */
1 = 'Government'
2 = 'Catholic'
3 = 'Independent' ;
....
RUN;
The second program is assigning the formats:
LIBNAME dataset 'path';
OPTION fmtsearch=(dataset);
proc datasets library = dataset ;
modify nameofdataset;
FORMAT
/* Wave 1 fixed formats */
STATEID STATEID.
SECTOR SECTOR.
....
;
QUIT;
I have a couple of proc datasets in this program, so that not all 5000 formats get assinged at once, which creates problems. The program works fine and assigns all formats (based on the log info). If I want to continue working with this file in a datastep, it gives me the following error message:"limit of 4096 formats in one single datastep has been exceeded" and if I have a look in the log, all formats after the 4096th create problems "format not found or could not be loaded". Also, if I want to view the dataset in the sas viewer it gives me an error message that table selected can't be opened...However, if I use STAT Transfer to export the dataset (incl. formats) to Stata, and open it in Stata, the dataset looks fine, including all formats. I had to increase memory in Stata, so I'm wondering whether there is something similar in SAS, so that I can keep working with this dataset in SAS.
Thanks for any help/tips/advice 🙂