#BEGINBUCKET UNLOADUSS
#/ ------------------------------------------------------------------
#BEGINDEFS
#/ ------------------------------------------------------------------
#/EXCEPTIONFORMISSINGSYMBOL
#TABLECALL <MVSDSDATATABLE> KEY:MVS2BDSCODE
#SYMBOLCALLS SYSOUT;SSDDIR1;SSDDIR2;SSDDIR3;CUSTPRODQUAL;STAGEQUAL;
#/ -------------------------------------------------
#BEGININSTANCEQUALIFIERS
#/ -------------------------------------------------
#IFEQ {ENCODE} [ORDERENCODING] #THEN PASSESENCODE
#IF [INSTALLENCODEDONLY] #THEN DOESNOTQUALIFY
#IFNOTEQ {ENCODE} NE #THEN DOESNOTQUALIFY
#PASSESENCODE
#IFEQ {ARTIFACTTYPE} DIR #CREATEINSTANCEFROMENTRY
#DOESNOTQUALIFY
#ENDQUALIFIERS
#/ -------------------------------------------------------------------
#BEGINPREFIX      #/ Prefix invokes SAS from targeted SAS installation
#/ -------------------------------------------------------------------
//* 
//UNLDUSS EXEC PGM=IKJEFT1B,DYNAMNBR=20                                    
//SYSTSPRT DD SYSOUT=[SYSOUT]                                            
//SCRIPT DD *
#! /bin/sh      #/ force default shell
PATH=$PATH:/bin:/usr/bin                                                 
export PATH                                                              
SASHOMEDIR='[SASHOME]'                                                  
export SASHOMEDIR  
msg="Beginning installation of SAS USS components."                     
echo $msg                                                               
rm -f [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr                            
echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr           
echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr             
                                                                        
if test ! -d $SASHOMEDIR                                                
then                                                                    
 mkdir -p $SASHOMEDIR                                                   
 rc=$?                                                                  
 if test ! "$rc" = 0                                                    
 then                                                                   
  msg="Unable to make the directory $SASHOMEDIR"                        
  echo $msg                                                             
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr         
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr           
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr             
  exit 12                                                               
 fi                                                                     
fi                                                                      
                                                                        
cd $SASHOMEDIR                                                          
rc=$?                                                                   
if test ! "$rc" = "0"                                                   
then                                                                    
 msg="Unable to change directory to $SASHOMEDIR"                        
 echo $msg                                                              
 echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr          
 echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr            
 echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr              
 exit 12                                                                
fi                                                                      
                                                                        
if test ! -d SASVersionedJarRepository/9.2/                             
then                                                                    
 mkdir -p SASVersionedJarRepository/9.2/                                
rc=$?                                                                   
 if test ! "$rc" = "0"                                                  
 then                                                                   
  msg="Unable to mkdir SASVersionedJarRepository/9.2/"                  
  echo $msg                                                             
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr         
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr           
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr             
  exit 12                                                               
  fi                                                                    
 fi                                                                     
                                                                        
if test ! -d SASGraphJavaApplets/9.2/                                   
then                                                                    
 mkdir -p SASGraphJavaApplets/9.2/                                      
rc=$?                                                                   
 if test ! "$rc" = "0"                                                  
 then                                                                   
  msg="Unable to mkdir SASGraphJavaApplets/9.2/"                        
  echo $msg                                                             
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr         
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr           
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr                 
  exit 12                                                                   
  fi                                                                        
 fi                                                                         
                                                                            
if test ! -d SASSQLLibraryForC/9.2/                                         
then                                                                        
 mkdir -p SASSQLLibraryForC/9.2/                                            
rc=$?                                                                       
 if test ! "$rc" = "0"                                                      
 then                                                                       
  msg="Unable to mkdir SASSQLLibraryForC/9.2/"                              
  echo $msg                                                                 
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr             
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr               
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr                 
  exit 12                                                                   
  fi                                                                        
 fi                                                                         
                                                                            
if test ! -d CGIToolsForTheWebServer/9.2/                                   
then                                                                        
 mkdir -p CGIToolsForTheWebServer/9.2/                                      
rc=$?                                                                       
 if test ! "$rc" = "0"                                                      
 then                                                                       
  msg="Unable to mkdir CGIToolsForTheWebServer/9.2/"                        
  echo $msg                                                                 
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr             
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr               
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr                 
  exit 12                                                                   
  fi                                                                        
 fi                                                                         
                                                                            
if test ! -d SASFoundation/9.2/                                             
then                                                                        
 mkdir -p SASFoundation/9.2/                                                
rc=$?                                                                       
 if test ! "$rc" = "0"                                                      
 then                                                                       
  msg="Unable to makedir SASFoundation/9.2/"                                
  echo $msg                                                                 
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr             
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr               
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr                 
  exit 12                                                                   
  fi                                                                        
 fi                                                                         
                                                                            
if test ! -L SVJR92                                                         
then                                                                        
 ln -s SASVersionedJarRepository/9.2/ SVJR92                                
rc=$?                                                                       
 if test ! "$rc" = "0"                                                      
 then                                                                       
  msg="Unable to establish link SVJR92"                                     
  echo $msg                                                                 
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr         
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr           
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr             
  exit 12                                                               
  fi                                                                    
 fi                                                                     
                                                                        
if test ! -L SGJA92                                                     
then                                                                    
 ln -s SASGraphJavaApplets/9.2/ SGJA92                                  
rc=$?                                                                   
 if test ! "$rc" = "0"                                                  
 then                                                                   
  msg="Unable to establish link SGJA92"                                 
  echo $msg                                                             
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr         
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr           
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr             
  exit 12                                                               
  fi                                                                    
 fi                                                                     
                                                                        
if test ! -L SQLC92                                                     
then                                                                    
 ln -s SASSQLLibraryForC/9.2/ SQLC92                                    
rc=$?                                                                   
 if test ! "$rc" = "0"                                                  
 then                                                                   
  msg="Unable to establish link SQLC92"                                 
  echo $msg                                                             
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr         
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr           
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr             
  exit 12                                                               
  fi                                                                    
 fi                                                                     
                                                                        
if test ! -L SCGI92                                                     
then                                                                    
 ln -s CGIToolsForTheWebServer/9.2/ SCGI92                              
rc=$?                                                                   
 if test ! "$rc" = "0"                                                  
 then                                                                   
  msg="Unable to establish link SCGI92"                                 
  echo $msg                                                             
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr         
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr           
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr             
  exit 12                                                               
  fi                                                                    
 fi                                                                     
                                                                        
if test ! -L SF92                                                       
then                                                                    
 ln -s SASFoundation/9.2/ SF92                                          
rc=$?                                                                   
 if test ! "$rc" = "0"                                                  
 then                                                           
  msg="Unable to establish link SF92"                           
  echo $msg                                                     
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr 
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr   
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr     
  exit 12                                                       
  fi                                                            
 fi                                                             
#/ -------------------------------------------------------------------
#BEGININSTANCE    #/ use internal SAS fastcopy procedure to copy source lib to target lib          
#/ -------------------------------------------------------------------
PRODHOME='SASFoundation/9.2/'
#IFEQ {PRODUCT} sqllibc #:PRODHOME='SASSQLLibraryForC/9.2/'
#IFEQ {PRODUCT} cgitools #:PRODHOME='CGIToolsForTheWebServer/9.2/'
#FORALL
#IFEQ {MODULENAME} websrv/sasweb/IntrNet9/tools/loadmgr #:PRODHOME='CGIToolsForTheWebServer/9.2/'
#ENDFORALL
#IFEQ {ARTIFACTNAME} vjr.dir #:PRODHOME='SASVersionedJarRepository/9.2/'
#IFNOTEQ {PRODUCT} graph #THEN NEXT
#IFEQ {ARTIFACTNAME} applets.dir #:PRODHOME='SASGraphJavaApplets/9.2/'
#NEXT
export PRODHOME
ssddir1='[SSDDIR1]'                    
ssddir2='[SSDDIR2]'                                         
ssddir3='[SSDDIR3]'                                                
ssddir4='[SSDDIR4]'                           
cntnam='/{LANG}/{ARTIFACTNAME}'                                               
cd $ssddir1$ssddir2$ssddir3$ssddir4$cntnam
cp -R -v -f * $SASHOMEDIR/$PRODHOME                                      
rc=$?                                                              
if test ! "$rc" = "0"                                              
then                                                               
  msg="Exceptions extracting $akfil"                              
  echo $msg                                                        
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr   
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr     
  echo "EXIT CODE($rc)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr 
  exit $rc                                                         
fi                                                                 
#/ -------------------------------------------------
#BEGINSUFFIX 
#/ -------------------------------------------------
cd $SASHOMEDIR/SF92/                                                  
if test -d vulcan                                                     
 then                                                                 
cd $SASHOMEDIR/SF92/vulcan/                                           
if test -d bin                                                        
  then                                                                
rm -rf bin                                                            
fi                                                                    
if test ! -d bin                                                      
 then                                                                 
 mkdir -p bin                                                         
 rc=$?                                                                
 if test ! "$rc" = 0                                                  
 then                                                                 
 msg="Unable to make the directory bin"                               
 echo $msg                                                            
 echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr        
 echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr          
 echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr            
 exit 12                                                              
 fi                                                                   
fi                                                                    
ln -e CONFIG ./bin/config                                             
rc=$?                                                                 
 if test ! "$rc" = "0"                                                
 then                                                                 
  msg="Unable to establish link to config"                            
  echo $msg                                                           
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr       
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr         
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr           
  exit 12                                                             
 fi                                                                   
ln -e ENGINE11 ./bin/engine11                                         
rc=$?                                                                 
 if test ! "$rc" = "0"                                                
 then                                                                 
  msg="Unable to establish link to engine11"                          
  echo $msg                                                           
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr       
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr         
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr           
  exit 12                                                             
 fi                                                                   
ln -e FBINTL ./bin/fbintl                                             
rc=$?                                                                 
 if test ! "$rc" = "0"                                                
 then                                                                 
  msg="Unable to establish link to fbintl"                            
  echo $msg                                                           
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr       
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr         
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr           
  exit 12                                                             
 fi                                                                   
ln -e GPRE ./bin/gpre                                                 
rc=$?                                                                 
 if test ! "$rc" = "0" 
 then                                                                    
  msg="Unable to establish link to gpre"                                 
  echo $msg                                                              
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr          
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr            
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr              
  exit 12                                                                
 fi                                                                      
ln -e ISQL ./bin/isql                                                    
rc=$?                                                                    
 if test ! "$rc" = "0"                                                   
 then                                                                    
  msg="Unable to establish link to isql"                                 
  echo $msg                                                              
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr          
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr            
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr              
  exit 12                                                                
 fi                                                                      
ln -e LIBFIRE ./bin/libfire                                              
rc=$?                                                                    
 if test ! "$rc" = "0"                                                   
 then                                                                    
  msg="Unable to establish link to libfire"                              
  echo $msg                                                              
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr          
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr            
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr              
  exit 12                                                                
 fi                                                                      
ln -e MSGS ./bin/msgs                                                    
rc=$?                                                                    
 if test ! "$rc" = "0"                                                   
 then                                                                    
  msg="Unable to establish link to msgs"                                 
  echo $msg                                                              
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr          
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr            
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr              
  exit 12                                                                
 fi                                                                      
ln -e QLI ./bin/qli                                                      
rc=$?                                                                    
 if test ! "$rc" = "0"                                                   
 then                                                                    
  msg="Unable to establish link to qli"                                  
  echo $msg                                                              
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr          
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr            
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr              
  exit 12                                                                
 fi                                                                      
ln -e SASTBACK ./bin/sastback                                            
rc=$?                                                                    
 if test ! "$rc" = "0"                                                   
 then                                                                    
  msg="Unable to establish link to sastback"
  msg="Unable to establish link to sastback"                            
  echo $msg                                                             
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr         
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr           
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr             
  exit 12                                                               
 fi                                                                     
ln -e SASTVER ./bin/sastver                                             
rc=$?                                                                   
 if test ! "$rc" = "0"                                                  
 then                                                                   
  msg="Unable to establish link to sastver"                             
  echo $msg                                                             
  echo "CONTROL ASIS" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr         
  echo "WRITE $msg" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr           
  echo "EXIT(12)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr             
  exit 12                                                               
 fi                                                                     
fi                                                                      
                                                                        
sasaid=`id -un`                                                         
sasagrp=`id -gn`                                                        
chown -fR $sasaid .                                                     
chgrp -fR $sasagrp .                                                    
chmod -fR 755 .                                                         
                                                                        
echo "EXIT CODE(0)" >> [OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr           
                                                                        
exit 0                                                                  
/*                                                                      
//DFALTERR DD *                                                         
CONTROL ASIS                                                            
WRITE Installation of SAS OpenEdition components failed.                
EXIT CODE(16)                                                           
//SYSTSIN DD *                                                          
 ALLOC FILE(OUTPUT) +                                                   
  PATH('[OSTEMPDIR]/[DATETIMEPFX].unlduss.sh') +                         
  PATHOPTS(OWRONLY,OCREAT) PATHMODE(SIRUSR,SIWUSR)                      
 OCOPY INDD(SCRIPT) OUTDD(OUTPUT) TEXT                                  
 ALLOC FILE(ERROUT) +                                                   
  PATH('[OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr') +                      
  PATHOPTS(OWRONLY,OCREAT) PATHMODE(SIRUSR,SIWUSR)                      
 OCOPY INDD(DFALTERR) OUTDD(ERROUT) TEXT                                
/*                                                                      
//*                                                                     
//SHELLRUN EXEC PGM=BPXBATCH,PARM='SH'                                  
//STDIN  DD PATH='[OSTEMPDIR]/[DATETIMEPFX].unlduss.sh',                 
//       PATHOPTS=(ORDONLY)                                             
//STDOUT DD PATH='[OSTEMPDIR]/[DATETIMEPFX].unlduss.out',                
//       PATHOPTS=(OWRONLY,OCREAT),PATHMODE=(SIRUSR,SIWUSR)             
//STDERR DD PATH='[OSTEMPDIR]/[DATETIMEPFX].unlduss.err',                
//       PATHOPTS=(OWRONLY,OCREAT),PATHMODE=(SIRUSR,SIWUSR)             
//*                                                                     
//SHELLOUT EXEC PGM=IKJEFT1B,DYNAMNBR=20                                
//SYSTSPRT DD SYSOUT=*                                                  
//STDOUT DD SYSOUT=*,DCB=(RECFM=VB,LRECL=136,BLKSIZE=140)               
//STDERR DD SYSOUT=*,DCB=(RECFM=VB,LRECL=136,BLKSIZE=140)               
//CLIST DD DISP=(NEW,CATLG), 
// DSN=[CUSTPRODQUAL].[ORDERENCODING].UNLDUSS.EXEC,               
// UNIT=VIO,SPACE=(TRK,(1,1)),                           
// DCB=(RECFM=VB,LRECL=255,BLKSIZE=6160)                 
//SYSTSIN DD *                                           
 ALLOCATE FILE(INPUT) PATHOPTS(ORDONLY) +                
   PATH('[OSTEMPDIR]/[DATETIMEPFX].unlduss.out')          
 OCOPY INDD(INPUT) OUTDD(STDOUT) TEXT                    
 FREE FILE(INPUT)                                        
 ALLOCATE FILE(INPUT) PATHOPTS(ORDONLY) +                
   PATH('[OSTEMPDIR]/[DATETIMEPFX].unlduss.err')          
 OCOPY INDD(INPUT) OUTDD(STDERR) TEXT                    
 FREE FILE(INPUT)                                        
 ALLOCATE FILE(INPUT) PATHOPTS(ORDONLY) +                
   PATH('[OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr')        
 OCOPY INDD(INPUT) OUTDD(CLIST) TEXT                     
 EXEC '[CUSTPRODQUAL].[ORDERENCODING].UNLDUSS.EXEC'               
/*                                                       
//*                                                      
//CLEANUP  EXEC PGM=IEFBR14                              
//DD1 DD PATH='[OSTEMPDIR]/[DATETIMEPFX].unlduss.sh',     
//     PATHOPTS=ORDONLY,PATHDISP=DELETE                  
//DD2 DD PATH='[OSTEMPDIR]/[DATETIMEPFX].unlduss.out',    
//     PATHOPTS=ORDONLY,PATHDISP=DELETE                  
//DD3 DD PATH='[OSTEMPDIR]/[DATETIMEPFX].unlduss.err',    
//     PATHOPTS=ORDONLY,PATHDISP=DELETE                  
//DD4 DD PATH='[OSTEMPDIR]/[DATETIMEPFX].unlduss.sherr',  
//     PATHOPTS=ORDONLY,PATHDISP=DELETE                  
//DD5 DD DISP=(MOD,DELETE,DELETE),                       
//  DSN=[CUSTPRODQUAL].[ORDERENCODING].UNLDUSS.EXEC               
//*                                                      
#/ ---------------------------------------------------------------  
#ENDBUCKET                                                                   