OS Command File Execution

This code is also available in: Français Deutsch Español English
Difficulty Level
Beginner
Published on :
Attention : This code requires administrator privileges.
This SAS© macro, named `_executeCMDFile`, is designed to execute a specified operating system command file. It supports checking the shell command's return code using operator and expected return code parameters. The macro encapsulates the call to an internal macro `_xcmd`, which is responsible for interfacing with the operating system for command execution.
Data Analysis

Type : NON_APPLICABLE


This macro does not directly handle data sources. Its primary purpose is the execution of operating system commands.

1 Code Block
MACRO DEFINITION
Explanation :
This block defines the `_executeCMDFile` macro. It accepts three parameters: `i_cmdFile` (the path to the command file to execute), `i_operator` (the operator for evaluating the return code), and `i_expected_shell_rc` (the expected shell return code). The macro delegates the actual command execution to the internal macro `%_xcmd`, passing the encapsulated parameters. This structure allows for controlled and parameterized system command execution.
Copied!
1%macro _executeCMDFile(i_cmdFile
2 ,i_operator
3 ,i_expected_shell_rc
4 );
5
6 %_xcmd("&i_cmdFile.", &i_operator., &i_expected_shell_rc.)
7 
8%mend _executeCMDFile;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Copyright Info : Copyright 2010-2023 HMS Analytical Software GmbH, http://www.analytical-software.de


Related Documentation

Aucune documentation spécifique pour cette catégorie.