Technology Tales

Notes drawn from experiences in consumer and enterprise technology

14:03, 3rd October 2022

SAS PYTHON Procedure

The PYTHON procedure in SAS Viya allows Python code to be run as a subprocess of a SAS Compute Server, either as a complete block using SUBMIT and ENDSUBMIT statements or one line at a time in interactive mode using INTERACTIVE and ENDINTERACTIVE statements. In batch mode, processing halts at the first error encountered, whereas interactive mode allows subsequent statements to continue running after an error, making it useful for debugging.

A built-in SAS module is automatically imported into each Python subprocess, providing callback methods that allow variables to be shared between SAS and Python, data to be moved between SAS datasets and Pandas DataFrames, SAS functions to be invoked and SAS code to be submitted directly from within Python. Two environment variables, PROC_PYPATH and PROC_M2PATH, must be configured by an administrator to point to the Python executable and the interface file respectively, and because the SAS Viya platform is locked down by default, the procedure must be explicitly enabled using the ENABLE_AMS option in the LOCKDOWN statement. Connecting to SAS Cloud Analytic Services from within the procedure requires the Python SWAT package along with two additional environment variables providing token-based authentication and an SSL certificate for secure communication.

09:39, 1st October 2022

Sample 68620: Create user home directories from the identities service in SAS® Viya® 2020.x using a script

A script is available to create user home directories in SAS Viya 2020.x by retrieving user identifiers from the identities service, which can be useful when external systems like LDAP do not provide these values. The script requires a specified directory path and SAS Viya environment URL, authenticates using a username, password, or token and generates directories with 0700 permissions owned by the user's uid and gid. It uses tools like jq and must be executed as root, with additional options allowing targeted user processing, ownership adjustments, or regeneration of identifiers if discrepancies arise from changes in the hashing algorithm used for ID generation after 2023.06. The script is provided without warranty or support, and users are advised to review its functionality and requirements before implementation.

09:37, 1st October 2022

Linux / UNIX: Bash Script Sleep or Delay a Specified Amount of Time

The sleep command in Bash scripting is used to introduce delays in Linux and Unix-like systems, with syntax allowing specification of time in seconds, minutes, hours, or days using suffixes such as s, m, h, or d. However, on BSD and macOS systems, the command only accepts seconds as integer values without suffixes.

Examples include pausing for 5 seconds with sleep 5, 2 minutes with sleep 2m, or 1.5 seconds with sleep 1.5 on GNU systems. The command is commonly integrated into scripts for timing between operations, loops, or waiting for processes to complete, while alternatives like the read command with a timeout can also be used for pauses.

12:05, 29th September 2022

SAS Processing Restrictions in a Locked-Down State

LOCKDOWN is a security feature in SAS Viya that restricts access to specific system files and programming functionalities by default, ensuring controlled execution of sessions on SAS servers. Enabled by default, it is managed by administrators through system options, statements and a lockdown allowlist, which defines permitted resources and access methods.

When activated, certain SAS language elements such as PROC PYTHON, PROC LUA IO functions and the SOCKET access method are disabled, while others like EMAIL and FTP remain available. File access is governed by the allowlist, which includes predefined paths such as SASROOT, JAVA_HOME and mounted volume directories, with administrators able to add additional paths or features as needed. This mechanism aims to enhance security by limiting potentially risky operations while maintaining access to essential system components and data.

15:14, 28th September 2022

SAS_PACKAGES - a SAS Packages Framework and Repository

The SAS Packages Framework is a tool designed to simplify the creation and sharing of SAS packages, which are self-contained zip files containing structured code along with metadata, load, unload and help files. These packages aim to streamline code distribution by separating complex developer dependencies from user interaction and reducing challenges associated with remote deployment. The framework provides documentation, tutorials and example packages, with updates including new macros and features to enhance functionality. It is supported by a community and used in various locations, with resources available for both developers and users to facilitate adoption and implementation.

17:02, 27th September 2022

R for Clinical Study Reports and Submission is a practical guide authored by Yilong Zhang, Nan Xiao, Keaven Anderson and Yalin Zhu, aimed at helping both novice and experienced R programmers use the language to prepare clinical study reports (CSRs) and submit them to regulatory agencies. CSRs are integral to clinical trial development, serving as comprehensive scientific records of individual trials, and their preparation is guided by the ICH E3 framework. The book covers the creation of tables, listings and figures, project management and the regulatory submission process, and has been presented at a number of industry events including the R/Pharma Conference, the ASA Biopharmaceutical Section Regulatory-Industry Statistics Workshop and the PSI Webinar Series.

17:01, 27th September 2022

SAS Mirror Manager for SAS Viya 3.4

SAS Mirror Manager is a tool used to create and manage mirror repositories for deploying SAS Viya 3.4, supporting both Linux and Windows environments as well as containerised deployments. It can be run locally without needing to be installed on the deployment environment itself, and is available for download in versions compatible with Linux, Macintosh and Windows on x64 architecture, each at roughly 4 MB in size. Instructions for downloading and using the tool are included in the deployment guide linked within the user's Software Order Email.

17:00, 27th September 2022

SAS Mirror Manager for SAS Viya

SAS Mirror Manager is a tool used to create and manage mirror repositories for deploying SAS Viya, and it can be run locally without needing to be installed on the deployment environment itself. It is available for download in versions compatible with Linux, Macintosh and Windows operating systems, each at approximately 7 megabytes in size, with instructions provided through the relevant deployment guide. SAS also offers supporting resources for users, including training options spanning classroom, live web, e-learning and one-on-one mentoring formats, as well as a globally recognised certification programme and a dedicated user group for administrators and architects.

18:06, 24th August 2022

Hello Shiny Python

In July 2022, the alpha release of Shiny generated considerable excitement among Python practitioners, who had long sought an equivalent to the R Shiny framework for building bespoke web applications. Installed via PyPI like any other Python package, Shiny follows the same fundamental two-part structure familiar to R Shiny users, comprising a user interface layer that generates HTML, CSS and JavaScript rendered in the browser, and a server function containing the application logic.

The UI and server communicate through uniquely identified input and output bindings, with the server receiving user-driven values and returning rendered results such as plots. A practical demonstration of this involves building an interactive application using the plotnine library to display diamond price data filtered dynamically by colour selection, illustrating how relatively straightforward it is to produce a functional, interactive data application in Python using the framework.

18:05, 24th August 2022

Shiny for Python

This framework for creating reactive data and AI applications in Python offers a streamlined approach to building interactive dashboards and web interfaces. It minimises manual state management by automatically determining execution paths, reduces unnecessary re-rendering through a reactive engine and integrates with modern Python tools to support custom styling and complex applications. Users can begin by installing the package, selecting a template and customising layouts with data, enabling the development of scalable and visually appealing applications with minimal setup.

  • The content, images, and materials on this website are protected by copyright law and may not be reproduced, distributed, transmitted, displayed, or published in any form without the prior written permission of the copyright holder. All trademarks, logos, and brand names mentioned on this website are the property of their respective owners. Unauthorised use or duplication of these materials may violate copyright, trademark and other applicable laws, and could result in criminal or civil penalties.

  • All comments on this website are moderated and should contribute meaningfully to the discussion. We welcome diverse viewpoints expressed respectfully, but reserve the right to remove any comments containing hate speech, profanity, personal attacks, spam, promotional content or other inappropriate material without notice. Please note that comment moderation may take up to 24 hours, and that repeatedly violating these guidelines may result in being banned from future participation.

  • By submitting a comment, you grant us the right to publish and edit it as needed, whilst retaining your ownership of the content. Your email address will never be published or shared, though it is required for moderation purposes.