BookmarkSubscribeRSS Feed

Script to make a list of export targets for Viya's job flow.

Started ‎02-23-2022 by
Modified ‎02-24-2022 by
Views 2,354

After reading the article "Promoting SAS Viya Job Flows", I realized that I am a lazy person. Creating a JSON file that defines what to export is very time-consuming and can keep me focused if I only have to do it once. But if I needed to export many jobs many times, I thought I would write a script. And I managed to create a working script.

 

The example screenshot shows the procedure of exporting a test flow "ant-flow". You can specify the name or ID of the flow as an argument to the script. Please install the sas-viya CLI before running this script, this will not work with Viya 3.x.

flow-request.pngant-flow.png

The following shows how the script retrieves the desired ID and URI. First, get the ID of the flow from its name.

cli-1.png

 

The next step is to use the ID of the flow as the key to search and get the URI of the flow and the jobs contained in the flow.

cli-2.png

 

Retrieve the jobRequestUri by searching for Actions with the job ID as the key. The ID of the job flow is recursively broken down into jobs.

cli-3.png

 

The script I attached is short and simple, and I think it can be easily modified. If you could point out any errors, I would be very grateful.

Version history
Last update:
‎02-24-2022 06:05 AM
Updated by:
Contributors

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

SAS AI and Machine Learning Courses

The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

Get started

Article Tags