Menu

#227 different location for sasunit installation and SAS programms

default
closed
nobody
None
v2.0.1
SAS_9.4_Windows
Enhancement_Request
Framework
4-low
2024-02-29
2024-01-22
mgross
No

We have a different location for program installations and the projects with the SAS-Programms

Installation (disk d):
sasunit

Project (disk f):
- main
- test
- sasunit_prj (with all SASunit project files e.g. bin, dat, doc etc.)

In sasunit.setup.9.4.cmd it is possible to set up this structure.

SET SASUNIT_TESTDB_PATH=%SASUNIT_PROJECTROOT%\sasunit_prj\%SASUNIT_LANGUAGE%\testdb
SET SASUNIT_LOG_PATH=%SASUNIT_PROJECTROOT%\sasunit_prj\%SASUNIT_LANGUAGE%\logs
SET SASUNIT_SCN_LOG_PATH=%SASUNIT_PROJECTROOT%\sasunit_prj\%SASUNIT_LANGUAGE%\scn_logs
SET SASUNIT_REPORT_PATH=%SASUNIT_PROJECTROOT%\sasunit_prj\%SASUNIT_LANGUAGE%\doc
SET SASUNIT_RUNALL=%SASUNIT_PROJECTROOT%\sasunit_prj\run_all.sas

but initsasunit.sas and runsasunitsetup.sas want the bin directory only in g_sProjectRootFolder, i_root (SASUNIT_PROJECTROOT).
It is possible to change initsasunit.sas and runsasunitsetup.sas to have all the sasunit project files to have in one directory?

in this constallation some directories are not created in initsasunit.sas:

%SASUNIT_PROJECTROOT%\sasunit_prj\bin
%SASUNIT_TESTDB_PATH%
%SASUNIT_LOG_PATH%
%SASUNIT_SCN_LOG_PATH%
%SASUNIT_REPORT_PATH%
%SASUNIT_PROJECTROOT%\sasunit_prj\dat
%SASUNIT_PROJECTROOT%\sasunit_prj\doc\spec
%SASUNIT_PROJECTROOT%\sasunit_prj\en\doc\tempDoc\crossreference

Discussion

  • Klaus Landwich

    Klaus Landwich - 2024-01-23

    Since we moved to GitHub I created a ticket there.

    From my point of view these are two points:
    - allow bin files to be moved
    - Check wether runsasunit creates all the necessary folders or not.

    Regards
    Klaus

     
  • Klaus Landwich

    Klaus Landwich - 2024-02-29

    This is a reasonable approach.
    As we created the setup script we didn't have that in mind.

    SASUnit currently is capable to do so, but not the setup routine.
    To minimze manual editing of script files you can do the following:
    1. Temoprarily created copy run_all.sas into ....\sasunit_prj\saspgm
    2. Configure setup script to have ...\sasunit_prj as SASUNIT_PROJECTFOLDER
    3. Start setup script
    4. Remove run_all and saspgm folder
    5. Update your run_all.sas to use absolute path to autocall members
    6. Update your run_all.sas to use absolute path to test scenarios in run_sasunit
    7. Update your bin\sasunit<...>.cfg to use correct path to run_all.sas in -sysin

    Here are examples of the changes you need to do:
    sasunit setup script file sasunit.setup.9.4.cmd:

    REM --------------------------------------------------------------------------------
    REM --- EnvVars for SAS Unit Configuration -----------------------------------------
    SET SASUNIT_ROOT=C:\TEMP\_SASUnitTest\v2.1
    SET SASUNIT_PROJECTROOT=C:\TEMP\_SASUnitTest\v2.1\example\sasunit_files
    SET SASUNIT_TESTDB_PATH=%SASUNIT_PROJECTROOT%\%SASUNIT_LANGUAGE%\testdb
    SET SASUNIT_LOG_PATH=%SASUNIT_PROJECTROOT%\%SASUNIT_LANGUAGE%\logs
    SET SASUNIT_SCN_LOG_PATH=%SASUNIT_PROJECTROOT%\%SASUNIT_LANGUAGE%\scn_logs
    SET SASUNIT_REPORT_PATH=%SASUNIT_PROJECTROOT%\%SASUNIT_LANGUAGE%\doc
    SET SASUNIT_RUNALL=%SASUNIT_PROJECTROOT%\saspgm\run_all.sas
    SET SASUNIT_LOG_LEVEL=INFO
    SET SASUNIT_SCN_LOG_LEVEL=INFO
    

    Update run_all.sas:

    %initSASUnit(
       i_root                     = %sysget(SASUNIT_PROJECT_ROOT)
      ,io_target                  = %sysget(SASUNIT_TEST_DB_FOLDER)
      ,i_overwrite                = %sysget(SASUNIT_OVERWRITE)
      ,i_project                  = SASUnit Examples                                  
      ,i_sasunit                  = %sysget(SASUNIT_ROOT)/saspgm/sasunit
      ,i_sasautos                 = C:/TEMP/_SASUnitTest/v2.1/example/saspgm
      ,i_testdata                 = %sysget(SASUNIT_PROJECT_ROOT)/dat
      ,i_refdata                  = %sysget(SASUNIT_PROJECT_ROOT)/dat                 
      ,i_doc                      = doc/spec
      ,i_sascfg                   = %sysget(SASUNIT_SAS_CFG)
      ,i_testcoverage             = %sysget(SASUNIT_COVERAGEASSESSMENT)
    
    /* Run specified test scenarios. There can be more than one call to runSASUnit */
    %runSASUnit(i_source = C:/TEMP/_SASUnitTest/v2.1/example/saspgm/%str(*)_test.sas);
    

    Update bin/sasunit.9.4.<os>.<language>.cfg:

    -CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg"
    -sysin  C:\TEMP\_SASUnitTest\v2.1\example\saspgm\run_all.sas
    -log    C:\TEMP\_SASUnitTest\v2.1\example\sasunit_files\en\logs
    -print  C:\TEMP\_SASUnitTest\v2.1\example\sasunit_files\en\logs
    

    This is the way to go with the least manual effort.

    We will incoporate this setup into our setup scripts.

    See here

     
  • Klaus Landwich

    Klaus Landwich - 2024-02-29
    • status: open --> closed
     

Anonymous
Anonymous

Add attachments
Cancel