SASPACer to create SAS package using excel file
- Package: SASPACer
- Version: 0.3.6
- Generated: 2025-10-16T20:25:52
- Author(s): Ryo Nakaya ([email protected])
- Maintainer(s): Ryo Nakaya ([email protected])
- License: MIT
- File SHA256:
F*B97036EAE02CC83013B0FE2AFF63556385D464CEBD8F33D009DAD06621C4C14Cfor this version - Content SHA256:
C*E9294BC897EB5817BDED91548767BD7C9FC0AE71A86256DFA080EE9EF7671FCAfor this version
SASPACer is a package for easily creating SAS packages.
All you need is to fill package information in the template excel file (you can find it in additional contents).
SASPACer has a macro(%ex2pac()) to convert excel with package information into
SAS package folders and files, and generate SAS package using the %generatePackage()
macro (the generation is optional but executed by default).
macro(%pac2ex()) can convert package zip file into excel file with package information.
list of macros:
%ex2pac()%pac2ex()
- Bartosz Jablonski, "My First SAS Package - a How To", SGF Proceedings, Paper 1079-2021, https://communities.sas.com/t5/SAS-Global-Forum-Proceedings/My-First-SAS-Package-A-How-To/ta-p/726319 https://communities.sas.com/kntur85557/attachments/kntur85557/proceedings-2021/59/1/Paper_1079-2021.pdf
Required SAS Components:
- Base SAS Software
- SAS/access interface to PC files
Package contains additional content, run: %loadPackageAddCnt(SASPACer) to load it
or look for the saspacer_AdditionalContent directory in the packages fileref
localization (only if additional content was deployed during the installation process).
SAS package generated by SAS Package Framework, version 20250729
The SASPACer package consists of the following content:
%ex2pac is a macro to convert excel file with package information into
SAS package folders and files.
-
excel_file(required) : full path for excel file which contains package information -
package_location(required) : location where package files to be stored. Subfolder named package name will be created under the location. -
complete_generation(option) : If user want to create only package structure, change complete_generation=N. (default is Y)
By default,%ex2pacexecute%generatePackage()to create .zip and .md.
Easy to understand the structure. Take a look anyway.
In sheets like macros, the %ex2pac uses body information if body column is filled,
while refers file in location column if body column is blank.
(This is a situation where macros(or other files) were already created somewhere in a file and
would like to use it instead of copying contents in body column of the excel.)
- Create package subfolder in the location. Name of the subfolder will be set as the package name.
- Create description.sas
- Create license.sas
- Create subfolders like 01_formats, 02_functions, etc. in reference to the excel sheet names.
- Create sas files based on information described in each excel sheet
- Run
%generatePackages()
%ex2pac(
excel_file=C:\Temp\template_package.xlsx,
package_location=C:\Temp\SAS_PACKAGES\packages,
complete_generation=Y)%ex2pacexpects the operating system to be either Windows or a non-Windows environment (such as Linux, Unix, etc.). The&SYSSCPmacro variable is used to identify the current OS.- Libref named
e2p_xlsandXLSCHKare used in the macro. - Max length of 32767 bytes is the limit in both cells in excel and reference file(.sas) in location column due to limitations in excel cell max length and max length of SAS variables used in the macro.
This is internal utility macro used in %ex2pac.
(Called in %ex2pac_allsheet macro)
Purpose: To create contents in xxx.sas reading excel sheet.
This is internal utility macro used in %ex2pac.
Purpose: To create sheets.
This is internal utility macro used in %ex2pac.
Purpose: To switch separator character (slash or back slash) based on OS.
%pac2ex is a macro to convert package zip file into
excel file with package information.
-
zip_path(required) : full path for package zip file -
xls_path(required) : full path for excel file to output -
overwrite(option) : N for not overwriting (default is Y) -
kill(option) : Y for kill all datasets in PAC2EX library created during%pac2ex(default is N)
- Scan package ZIP contents
- Read each ZIP entry line-by-line into PAC2EX.xxx datasets
- Process DESCRIPTION and LICENSE
- Process macros/contents calling
%pac2ex_contents - Export to Excel sheets calling
%pac2ex_folder2sheet
%pac2ex(
zip_path=C:\Temp\packagename.zip,
xls_path=C:\Temp\package_info.xlsx,
overwrite=Y,
kill=Y
)Not applicable.
This is internal utility macro used in %pac2ex.
Purpose: To create datasets by contents.
This is internal utility macro used in %pac2ex.
Purpose: To output contents into excel sheet.
Copyright (c) [2025] [Ryo Nakaya]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.