#BEGINBUCKET SASREGISTRYIMPORTSTG
#/ ------------------------------------------------------------------
#BEGINDEFS
#/ ------------------------------------------------------------------
#TABLECALL <MVSDSDATATABLE> KEY:MVS2BDSCODE
#/ -------------------------------------------------
#BEGININSTANCEQUALIFIERS
#/  This bucket exists to provide a single SAS fireup for items installed under SAS. It resolves if any SDL or XRG
#/  is in the payload for any of the delivered altsku's. Note that this bucket only contains a prefix and the 
#/  instance generates no code.
#/ -------------------------------------------------  
#IFEQ {ARTIFACTTYPE} XRG #CREATEINSTANCEFROMENTRY
#ENDQUALIFIERS
#/ -------------------------------------------------------------------
#BEGINPREFIX
#/ -------------------------------------------------------------------
#/        Prefix invokes SAS from targeted SAS installation. First creates a copy
#/        of the existing registry itemstore in the new staged sashelp. This is required
#/        in because in a concatenated SASHELP, only the first itemstore of a concatenated
#/        pair is used -- there is no lookthrough in content. Second SAS refires using
#/        the concatenated sashelp, and performs the proc registry imports.
#IFNOT [INSTALL-TO-STAGE] #THEN NOTSTAGEDINSTALL
//SASCPYUP EXEC PGM=[ENTRY],                       
//  PARM=('SETINIT MSGCASE CAPSOUT ERRORABEND NOWORKTERM',     
//        'MACRO ERRORCHECK=STRICT SASUSER=WORK')
#TABLEFIX <MVSDSDATATABLE> LD  #/ Load Library
//STEPLIB  DD DISP=SHR,                                        
//  DSN=[CUSTPRODQUAL].[LOQUAL]                                       
#TABLEFIX <MVSDSDATATABLE> AU  #/ Autocalls
//[DFLTDDN] DD DISP=SHR,                                        
//  DSN=[CUSTPRODQUAL].[LOQUAL]                                        
#TABLEFIX <MVSDSDATATABLE> SM  #/ SAS messages
//[DFLTDDN] DD DISP=SHR,                                        
//  DSN=[CUSTPRODQUAL].[LOQUAL]                                        
#TABLEFIX <MVSDSDATATABLE> SH  #/ Sashelp
#SET [SASHELPDDN] [DFLTDDN]
//[SASHELPDDN]  DD DISP=SHR,                                        
//  DSN=[CUSTPRODQUAL].[LOQUAL] 
//SASCOPY  DD DISP=OLD,
//  DSN=[CUSTPRODQUAL][STAGEQUAL].[LOQUAL]
//WORK     DD UNIT=[TMPUNI],SPACE=(6144,([WORKSPC])),          
//         DCB=(RECFM=FS,LRECL=6144,BLKSIZE=6144)              
//SASLOG   DD SYSOUT=[SYSOUT]                                  
//SASCLOG  DD SYSOUT=[SYSOUT]                                  
//CONFIG   DD DISP=SHR,  #/ Using configuration file for install, not customer's
//         DSN=[CNTLDSN]($CFGINST)                             
//SASLIST  DD SYSOUT=[SYSOUT]                                  
//SASPARM  DD UNIT=[TMPUNI],SPACE=(400,(100,300)),             
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=400,BUFNO=1)         
//SYSIN  DD DATA,DLM='!^'  #/ Begin source code stream for SAS session. Delimiter is !^ in column 1 of line
proc copy in=[SASHELPDDN] out=SASCOPY;
select regstry memtype=itemstor;
run;
!^
//*
#NOTSTAGEDINSTALL
//SASXREG EXEC PGM=[ENTRY],                       
//  PARM=('SETINIT MSGCASE ERRORABEND NOWORKTERM',  
#IFEQ [ORDERENCODING] WU #://        'CAPSOUT',
//        'MACRO ERRORCHECK=STRICT SASUSER=WORK')
#TABLEFIX <MVSDSDATATABLE> LD  #/ Load Library
//STEPLIB  DD DISP=SHR,                                        
//  DSN=[CUSTPRODQUAL].[LOQUAL]                                       
#TABLEFIX <MVSDSDATATABLE> SH  #/ Sashelp
#IFNOT [INSTALL-TO-STAGE] #THEN NOTSTAGEDINSTALL
//STGSHELP  DD DISP=OLD,                                        
//  DSN=[CUSTPRODQUAL][STAGEQUAL].[LOQUAL]                                
//PRDSHELP  DD DISP=SHR,                                        
//  DSN=[CUSTPRODQUAL].[LOQUAL]
#THEN NEXT
#NOTSTAGEDINSTALL
//SASHELP DD DISP=OLD,                                        
//  DSN=[CUSTPRODQUAL].[LOQUAL]
#NEXT
#TABLEFIX <MVSDSDATATABLE> AU  #/ Autocalls
//[DFLTDDN] DD DISP=SHR,                                        
//  DSN=[CUSTPRODQUAL].[LOQUAL]                                        
#TABLEFIX <MVSDSDATATABLE> SM  #/ SAS messages
//[DFLTDDN] DD DISP=SHR,                                        
//  DSN=[CUSTPRODQUAL].[LOQUAL]                                        
//WORK     DD UNIT=[TMPUNI],SPACE=(6144,([WORKSPC])),          
//         DCB=(RECFM=FS,LRECL=6144,BLKSIZE=6144)              
//SASLOG   DD SYSOUT=[SYSOUT]                                  
//SASCLOG  DD SYSOUT=[SYSOUT]      
//CONFIG   DD DISP=SHR,  #/ Using configuration file for install, not customer's
//         DSN=[CNTLDSN]($CFGINST)
//         DD DATA,DLM='!^'   #/ Begin instream override of $CFGINST to create concatenated SASHELP
#IF [INSTALL-TO-STAGE] #:SASHELP=(STGSHELP + PRDSHELP)
!^
//SASLIST  DD SYSOUT=[SYSOUT]                                  
//SASPARM  DD UNIT=[TMPUNI],SPACE=(400,(100,300)),             
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=400,BUFNO=1)         
//SYSIN  DD DATA,DLM='!^'  #/ Begin source code stream for SAS session. Delimiter is !^ in column 1 of line
%macro imprtxrg;               #/ Invoke SAS macro compiler.
#/ -------------------------------------------------------------------
#BEGININSTANCE              
#/ -------------------------------------------------------------------
data _null_; %let ssddir1 =  #/ pull in root dir in parts to fix FB80 MVS lines
[SSDDIR1]                    #/ part 1 of path
; %let ssddir2 =
[SSDDIR2]                    #/ part 2 of path
; %let ssddir3 =
[SSDDIR3]/                    #/ part 3 of path
; %let ssddir4 =
{ALTSKU}                     #/ altsku portion of path
; %let ssdxrg = /{ARTIFACTNAME};  #/ artifact name
  filename inxrg pipe "cat &ssddir1&ssddir2&ssddir3&ssddir4&ssdxrg/*";
  proc registry usesashelp mark import=inxrg;
  run;                                           
  filename inxrg clear;
#/ -------------------------------------------------------------------
#BEGINSUFFIX                 #/ This suffix is intentionally null
#/ -------------------------------------------------------------------
mend imprtxrg; imprtxrg    #/ close macro and execute macro
!^
//*
#ENDBUCKET SASREGISTRYIMPORTSTG
