Diagnosing SLC Autocall Issues
Check File Permissions
Ensure SAS/SLC can read the files
ls-la /opt/slc_autocall/chmod644/opt/slc_autocall/*.sas
Verify File Naming
File name must match macro name and the file name is case-sensitive. For Linux, it is recommended to use all lower-case file names and no blanks/spaces in the file name.
ls/opt/slc_autocall/slc_connect_to_bq_libname.sas#Shouldexist
Enable Macro tracing for Debugging
Because macro processing dynamically injects code into the SLC execution stack, by default, not all of the generated statements are echoed to the SLC log. It is recommended users enable the following options for macro debugging purposes.
/* Enable macro debugging */ options mlogicmprint symbolgen;/* Try calling your macro */%slc_connect_to_bq_libname();/* You should see messages like: // * NOTE: The macro SLC_CONNECT_TO_BQ_LIBNAME was compiled from/opt/slc_autocall/slc_connect_to_bq_libname.sas */
Issue: "Macro not resolved"
WARNING: Apparent invocation of macro "slc_connect_to_bq_libname" not resolved
Solutions:
- Check if file exists: /opt/slc_autocall/slc_connect_to_bq_libname.sas
- Verify SASAUTOS includes /opt/slc_autocall
- Ensure file permissions are readable (644)
Issue: "File not found"
Solutions:
- Use absolute paths in SASAUTOS option
- Check directory permissions (755)
- Verify SLC users have read & write access to the directory files
Issue: Macro compiles but doesn't work Solutions:
- Ensure file contains only one macro
- Macro name in file must match filename
- Check for syntax errors in macro
Best Practices
Directory Organization
Use a structured directory organization scheme. This is especially true when an
organization has large number of members (.sas programs) within the Autocall macro library. This eases the maintenance burdens.
In our test environment ,we use:
/opt/slc_autocall/├──connection_macros/│├──slc_connect_to_bq_libname.sas│└──slc_connect_to_oracle.sas├──utility_macros/│├──log_message.sas│└──check_permissions.sas└──validation_macros/└──test_connections.sas
Defining Autocall Search Directories
options sasautos=( "/opt/slc_autocall" "/opt/slc_autocall/connection_macros" "/opt/slc_autocall/utility_macros" sasautos);
Use File Header Templates
SAS macros can pass parameters by two methods:
- Positional parameters
- Parameter name
In the header of the macro source program it is recommended the authors provide several examples of usage.
/**MACRO_NAME.SAS - Autocall macro file*Purpose: [Description]*Author: [Your name]*Date: [Date]*Usage: %macro_name(parameter1, parameter2);**Parameters:*parameter1 - Description*parameter2 - Description*Returns: [Description]*/%macro macro_name(parameter1,parameter2); /*Macrocodehere*/%mend macro_name;
Understanding SLC Autoexec Processing Behaviors
Overview
The autoexec.sas file is a special SAS program that automatically executes every time SLC is initialized. It's used to set up your environment, configure options, or establish connections to resources needed in SLC sessions. The convention is edit a SAS language program called autoexec.sas. It’s placement on the file system is discussed below.
The autoexec.sas program must contain valid SAS language syntax. These SAS language statements are the first statements executed by SLC before users can execute their SAS language statements.
This behavior makes it a convenient method to standardizing SLC execution environments with an administrator managing/controlling a single source file. Examples of items that might be included in AUTOEXEC processing include establishing a set of global macro variables for all users providing which represent resource-specific connections.
This arrangement provides an abstraction so users can make references to ‘logical resource definitions’ without having to understand the machinery needed to make such connections work. Administrators have the benefit of managing/editing a single file to handle physical resource changes so users do not need to make program changes in individual programs replying on the resource.
AUTOEXEC Precedence Order
SLC looks for autoexec.sas in these locations (in order):
- Current working directory: ./autoexec.sas
- User home directory:~/autoexec.sasor/home/username/autoexec.sas
- SLC installation directory:/opt/altair/slc/2026
- System-wide location: /opt/slc_sasauto/autoexec.sas
- This is the location we used with these samples.
To enable AUTOEXEC processing for all users, change the SLC configuration files, usually found at:
/opt/altair/slc/2026
As a best practice, do not alter the Altair -suppliedaltairslc.cfg file in this configuration directory. Local modification to this configuration file should be made in the file: altairslc_local.cfg.
In the configuration file, altairslc_local.cfg add the-AUTOEXEC directive:
-AUTOEXEC/opt/slc_autocall/autoexec.sas
In order for this change to take effect restart the SLC server. For an example of a work AUTOEXEC processing program, see Appendix A: Example Autoexec.sas. Also see Passing Environment Variables to SLC.
When SLC finds and executes the AUTOEXEC.sas program, it adds the following note to the log similar to:
NOTE: AUTOEXEC processing beginning; file is /opt/slc_autocall/autoexec.sas.