/******************************************************************************
 * Programme : Script de test pour le macro %m_utl_xpt2ds
 * Reference : SCRIPT4793
 * Source    : https://www.wearecas.eu/en/sampleCode/SCRIPT4793
 ******************************************************************************/

/* --- BLOC 1 --- */
%* Example 1: Show help information: ;
%m_utl_xpt2ds(?)

/* --- BLOC 2 --- */
%* Example 2: Step 1 - Export the CLASS table to a default XPT file named class.xpt: ;
%loc2xpt(
   libref   = SASHELP
 , memlist  = class
 , filespec = %unquote(%bquote('%sysfunc(getoption(WORK))/class.xpt'))
 , format   = AUTO
   );

/* --- BLOC 3 --- */
%* Example 2: Step 2 - Import the class.xpt transport file into a SAS dataset: ;
%m_utl_xpt2ds(
   in_file = %str(%sysfunc(getoption(WORK))/class.xpt)
 , out_lib = WORK
 , memlist = _ALL_
 , debug   = Y
   );

/* --- BLOC 4 --- */
proc print data=WORK.class;
run;

/* --- BLOC 5 --- */
%* Example 3: Step 1 - Export the CLASS table to an extended XPT file named class.xpt: ;
%loc2xpt(
   libref   = SASHELP
 , memlist  = class
 , filespec = %unquote(%bquote('%sysfunc(getoption(WORK))/class.xpt'))
 , format   = V9
   );

/* --- BLOC 6 --- */
%* Example 3: Step 2 - Import the class.xpt transport file into a SAS dataset: ;
%m_utl_xpt2ds(
   in_file = %str(%sysfunc(getoption(WORK))/class.xpt)
 , out_lib = WORK
 , memlist = _ALL_
 , debug   = Y
   );

/* --- BLOC 7 --- */
proc print data=WORK.class;
run;

