/**********************************************************************/


   /* Disk Space Management */

   /* Read user VSAM catalog and create a SAS data set (VSECPE2)     */
   /* in WORK that gives the entryname (ENTNAME) and filetype        */
   /* (FILET) of every file in the catalog.  SASVA01X is a free      */
   /* program in plib(psub) that is used for CPE.                                */
FILENAME IJSYSUC VSAM 'your.catalog.name' VSAMCAT=NONE;
FILENAME BJSYSUC VSAM 'your.catalog.name' VSAMCAT=IJSYSUC;

   /* read catalog/create VSECPE2                                    */
%INCLUDE plib(psub.SASVA01X.SAS); 

   /* Use VSECPE2 to create SAS job that when run will create two    */
   /* datasets: 'SAS' containing physical names of all SAS data libs */
   /* and 'NONSAS' containing physical names of all non-SAS files.   */
DATA _NULL_;
   RETAIN I 0;
   FILE vselib(sublib.BACKUP.VSAMCAT) REPLACE;
   SET VSECPE2;
   I=I+1;
   CI=PUT(I,3.);
   DO;
      LENGTH QT $ 1;
      QT="'";
      ENTNAME1="'"||ENTNAME||QT;
      ENTNAME1=COMPRESS(ENTNAME1);
      LENGTH LBN $ 8;
      LBN="LBN"||CI;
      LBN=COMPRESS(LBN);
      PUT ' %MACRO DOIT; ';
      PUT "    DATA TEMP;";
      PUT "      LENGTH FNAME $ 30;" ;
      PUT "      FNAME =  '" ENTNAME "';";
      PUT "      OUTPUT TEMP;";
      PUT "    RUN;";
      PUT "    LIBNAME FOO " ENTNAME1 " DISP=SHR CAT=BJSYSUC;";
      PUT ' %IF &SYSLIBRC=0 %THEN %DO;';
      PUT "    PROC APPEND BASE=SAS    DATA=TEMP ; RUN;";
      PUT " %END;";
      PUT " %ELSE %DO;";
      PUT "    PROC APPEND BASE=NONSAS DATA=TEMP ; RUN;";
      PUT " %END;";
      PUT " %MEND; %DOIT;";
      PUT "RUN;";
  END;
RUN;

   /* Run job created by step above.                                 */
%INCLUDE vselib(sublib.BACKUP.VSAMCAT);

   /* Print list of SAS data libraries and non-SAS files.            */
PROC PRINT DATA=SAS;
PROC PRINT DATA=NONSAS;


/**********************************************************************/


   /* Backup */

DATA _NULL_;
   RETAIN I 0;
   HOLDER = ' ';   RETAIN HOLDER;
   FILE vselib(sublib.BACKUP.SASLIBS) REPLACE ;
   SET SAS;                    /* input data set of filenames        */
   I=I+1;
   CI=PUT(I,3.);
   LENGTH QT $ 1;
   QT="'";
   PNAME1="'"||FNAME||QT;
   PNAME1=COMPRESS(PNAME1);
   LENGTH LBN $ 8;
   LBN="LBN"||CI;
   LBN=COMPRESS(LBN);
   PUT "   LIBNAME  " LBN " TAPE ASSGN=SYSxxx; " ;
   PUT "   LIBNAME FOO " PNAME1 " DISP=SHR CAT=BJSYSUC;";
   PUT "   PROC COPY IN=FOO OUT=" LBN " MEMTYPE=ALL ; 
RUN;";
   PUT "                      ";
RUN;

%INCLUDE vselib(sublib.BACKUP.SASLIBS);


/**********************************************************************/


   /* Memory/Performance */

* $$ JOB JNM=SASSVA,CLASS=0,DISP=H
* $$ LST CLASS=A
// JOB SASV6SVA - PLACE SAS V6 PHASE(S) IN SVA
// EXEC PROC=SASIFLE
// SETPARM PLIB=''
// SETPARM PSUB=''
// EXEC PROC=SASIPARM,PLIB,PSUB
// LIBDEF *,SEARCH=(&PLIB..&PSUB)
SET SDL
SASEBL,SVA
SASEBLU,SVA
/*
/&
* $$ EOJ  


/**********************************************************************/