/******* MVSArchive v5 fmtlib to UNIX format libraries *********/ options linesize=80 nocenter; /* The MVS Archive contains many SAS version 5 format libraries which were converted during the MVS to UNIX migration into SAS format CNTL data sets in XPORT format. This document describes the steps necessary to use these v5 format libraries under UNIX. Lets assume you have checked out a v5 format library with the name "mvsid.fmtlib01". It was created on our long gone MVS system using PROC CONTENTS with the CNTLOUT= option. Since it is in XPORT format, you have to specify the XPORT engine, and because it is a data library you have to reference it with a LIBNAME statement rather than a FILENAME statement. A PROC CONTENTS on it will show us what it contains. */ libname mvsfmt xport "mvsid.fmtlib01"; proc contents data=mvsfmt._all_; run; /* Reviewing the output from the above code, we see that the library contains one data member, and that data member is called (probably) "FMTS". Examining the variable names, you will find they contain the same things that PROC FORMAT needs to create a format library. This makes sense, especially since SAS created these puppies from format libraries on MVS in the first place! */ /* The trick now is to get PROC FORMAT to recreate a format library so we can use these formats in our programs. This requires a directory which we need to reference with the libname LIBRARY -- that's a special name that SAS uses when it looks for formats. If you haven't already got a directory to use as your format library, create one now. On UNIX systems the following SAS X command will create one in the current directory, but you can do it from your command shell. NOTE: You only have to do this part once. */ x 'mkdir mvsfmtlib'; /* Now you need to associate the library name LIBRARY with this directory. The following LIBNAME statement does just that. */ libname library "mvsfmtlib"; /* Now you can get PROC FORMAT to use the CNTLIN= option to read in the data and add the formats contained therein to your new format library. Remember, we have to reference the member named FMTS in the library with the libname MVSFMT. Here we go... */ proc format library=library cntlin=mvsfmt.fmts; run; /* Now we use one last PROC FORMAT to get a description of all the formats in the format library. This will be a good reference as you try to understand old code or create new code that uses these formats. */ proc format library=library fmtlib; run; /* And that's it! You should now be in business. Todd_Lewis@unc.edu July 10, 1998 */