How can I schedule a stored process in SAS DI Studio? - sas

I would like to use Enterprise Guide as a development environment for creating a SAS job (Base SAS code only), but I then need to use DI Studio to schedule that job to run at a particular time.
I want to use EG for developing the job because I believe it is a better development environment (program editor etc.) than DI.
I also want the job to exist as a stored process so that users can run it outside the schedule if necessary.
Can I create a simple DI Studio job that merely calls an existing stored process?

Of course - there are many ways to achieve this. One is to create a separate job (with 'user written code' component) and Stored Process, both of which simply %include your Enterprise Guide program.
Another is to create your stored process using Enterprise Guide, and then in DI Studio (user written code) call the stored process directly using proc stp (see documentation)
Yet another is to paste your EG code into DI Studio and 'deploy job as stored process' - documentation for that is here.
Oh, and to answer your 'headline' question - you don't schedule jobs in DI! The deployed .sas code can be scheduled via Schedule Manager (SMC), the OS itself, or other third party tools (eg LSF).

Related

DOS commands in SAS Enterprise Guide

I'd like to run some DOS commands in SAS Enterprise Guide. I did it in 9.3 and used the X command. For example: x 'mydir';
X is disabled in Enterprise Guide, as far as I can tell. Mine hangs when I try to use it.
Is there a straightforward way to run DOS commands in Enterprise Guide?
Enterprise Guide is just a front end to submit SAS code to a remote process/server where SAS itself is running. So Enterprise Guide is never going to run any commands.
If the XCMD option is turned on in the SAS session that your Enterprise Guide project is using to run SAS code then the SAS code submitted by your Enterprise Guide process could use the X, SYSTEM or a filename PIPE to run operating system commands. And if the system where that SAS session is running is using the Windows operating system then you could submit "DOS" commands from your SAS code.
But if the system where SAS is running is using UNIX then you could only submit UNIX commands.
And if the XCMD option is disabled then you cannot submit any commands.
If you want to submit commands to run on the machine where you are running Enterprise Guide then you would need to have SAS for Windows installed on that same machine and be connected to that version of SAS (versus some other SAS application server you might have access to).
In order to have Enterprise Guide perform local operating system interactions you can also create a custom add-in. From the documentation
Overview
Custom add-in tasks are .NET assemblies (DLL files) that you create, deploy, register in SAS Enterprise Guide, and execute from the SAS Enterprise Guide task list or add-in menu.
To provide access to custom tasks based on the job responsibilities, you can register custom tasks as capabilities, assign capabilities to roles, and assign users to roles.
Create Custom Tasks
To create custom tasks, you develop Windows executables and package them as .NET assemblies. It is convenient to assemble multiple tasks in a single .NET assembly so that you can share code and implementation among the tasks. For additional information, sample DLLs, and sample executable source files, see the topic “Creating Custom Add-In Tasks for SAS Enterprise Guide,” at Custom Tasks.

Would like to get build information from Google Cloud Profiler

I'm using Google Cloud Profiler (located at https://console.cloud.google.com/profiler) and would like to know how my profiling data changes across different builds of my application.
One way to do that would be to check the range of dates during which a particular commit was running on production, but that's time consuming because I have to:
Get the start date/time of release, determine the date/time of the next release
Set those dates manually in the profiler interface from the link above
That's really not terrible, but it'd be great to be able to set BUILD_ID environment variable like I can in Cloud Build and then be able to access that from the UI. Is something like this possible? Or is my approach the best way to do this at the moment?
Comparing across service versions would likely be a simpler and more precise way to do this (as opposed to using the time interval to select for profiles). To compare across service versions, it is necessary that the profiling agents set the service version.
The service version can be specified in the configuration passed to the agent (for the Go, Python, or Node.js agent) or via the -cprof_service_version flag (for the Java agent). If one is setting the service version using the configuration passed to the agent (applicable for the Go, Python, and Node.js agents), it may be convenient to use a flag or command line argument to set the service version so that the source code won't need to updated with each new version.
If one is running on Knative or App Engine standard, the service version should be auto-populated. These environments set the K_REVISION and GAE_VERSION environment variables (respectively), and the profiling agents (for all supported languages) use these environment variables to populate the service version. If one is running in another environment and modifying the source code is inconvenient or infeasible, one can set either the K_REVISION or GAE_VERSION environment variable in the environment running the application with the agent enabled to specify the service version.
My understanding is that the BUILD_ID is available at build time, but not at run time, so I don't know that it's possible for agents to use that directly.
(Disclosure: I work on Cloud Profiler at Google)
You can set the service version for this purpose. Please refer to the agent documentation for how to set it for supported languages.
For example, this shows using ServiceVersion for Go services.

Exporting VM/vAPP in vCloud environment

We have a customised vCloud environment. We are trying to download the vAPP image as ovf file for migrating it to some other environment. I am following this procedure
Stop the VM.
Click on download button on setting
It asks for download location and type of image (ova/ovf).
It initiates the download.
Now my problem lies on 4th step. When I click download it initiates download and I could see "enabling download" when it happened. After some unknown time(can't predict the time may be 2hr, 3hr 4hr, 1hr) the process gets failed. I have to repeat the process multiple times(at least 3 to 5 times) to start the actual download process where it actually copies the VM image on disk.
I am not able to predict the actual time of VM download and why the process get failed many time before it start the actual export process.
Can someone tell me answers of below mentioned questions
Does vCloud enable download functionality before it allows us to download the VM? If it does how much time it takes for this functionality to enable.
Can we enable this functionality beforehand so that vCloud should just start the VM download process instantly once I shutdown the machine and start the VM export process?
Do you think using CLI tool like ovftool will make the process faster and prevent it from failing so that I will get to know the actual VM download time and we can prepare a plan for migration?
From my limited understanding of working with the API and SDK, I do not think 1 is possible... if it is... it's not straightforward.. at least to me
as for #3 if you are not using the CLI for scripting and automating purposes, yes it would definitely help

How to run SAS using batch if I do not have it locally

Is there a way to run SAS using batch if I don't have the sas.exe in my machine?
My computer has the SAS EG but the code is ran on our companies servers
Thanks
If you are asking whether it is possible to run SAS batch on your local machine without having SAS on your local machine, the answer is no.
If you are using EG to connect to a SAS server, and you want to execute a batch job on the SAS server, that is possible (just not with EG). For example, if you have terminal access to the SAS server via putty or whatever, you can do a batch submit.
Enterprise Guide is quite capable of scheduling jobs, whether or not you have a local SAS installation.
Wendy McHenry covers this well in Four Ways to Schedule SAS Tasks. Way 1 is what you probably are familiar with ('batch'), but Ways 2 through 4 are all possible in server environments.
Way 2 is what I use, which is specifically covered in Chris Hemedinger's post Doing More with SAS Enterprise Guide Automation. In Enterprise Guide since I think EG 4.3, there has been an option in the File menu "Schedule ...", as well as a right-click option on a process flow "Schedule ...". These create VBScript files that can be scheduled using your normal Windows scheduler, and allow you to schedule a process flow or a project to run unattended, even if it needs to connect to a server.
You need to make sure you can connect to that server using the credentials you'll schedule the job to run under, of course, and that any network connections are created when you're not logged in interactively, but other than that it's quite simple to schedule the job. Then, once you've run it, it will save the project with the updated log and results tabs.
If your company uses the full suite of server products, I would definitely recommend seeing if you can get Way 3 to work (using SAS Management Console) - that is likely easier than doing it through EG. That's how SAS would expect you to schedule jobs in that kind of environment (and lets your SAS Administrator have better visibility on when the server will be more/less busy).

Want to make a Job on Hudson C/C++

Hopefully I find here someone who has experience with Hudson and its functions.
Now . I have Hudson installed this did not reveal any problems. But now I want to create a new job and that I'm developing in C / C + +.
In addition, I am working on Subversion svn where I run on the first error. Hudson did not find my svn . He says that I need an authentication . As I learned I can at Hudson authenticate but that does not work .
Maybe one of you knows how to create a project.
The things should be done in the job of Hudson.
Hudson is on my computer (local ) delete my project.
Then Hudson to access my SVN and check out the project from there.
The whole is now compiling Hudson . ( The best would be a compiler for C / C + + for Visual Studio 2008 compiler ) . The compiler then creates a * . Exe file.
Now Hudson to start the project on the basis of the *. Exe file and run the program .
Last but not least is to Hudson case of an error or if it was all right, inform the persons working on the project via email.
So that would be it what I 've hoped of Hudson. Otherwise, I take the whole not much. I know that I can do all this via a batch file . But that's not my goal. I want Hudson to automate so that I can start at midnight my builds / tests daily.
Do you think that at Hudson are my requirement too high?
For your help I would be very grateful , as I am stuck for days.
Here is a "basic" Hudson job
Create a new free-style software project job.
Configure that job.
(Optional) Configure triggers, such as "timer", "SCM polling", or others.
(Optional) Under Source Code Management section, select your SCM source and configure your repositories and local workspace
Under Build section, select Add build step and select:
Execute Shell if on *nix
OR
Execute Windows Batch Command if on Windows
OR
Pick whatever build-step plugin you are using.
(If using either of the "execute" build steps) Write your build/make/compile command as you would from command line.
(If using another plugin build step) Configure the plugin options according to your requirements.
(Optional) Archive the artifacts of the build with Archive the artifacts under Post-build Actions
(Optional) Execute other post-build actions
(Optional) Send out an email
Now to address your specific scenario. First things first, your question is too broad, and may get locked. Don't get discouraged if that happens, create separate question for each item individually. I cannot cover in details all these items, but I will give you an overview.
The SCM part
Based on your previous question, No Credentials to try in Hudson, I am now guessing that you are not providing Hudson with an HTTP URL to your SVN server, but trying to give it your local workspace location... Please do the command line check that I asked in that question.
You need to provide it with a proper HTTP server URL. Hudson will check out the project from the SVN URL you provided, under what is called a Workspace. The location of workspace can differ, based on your Hudson configuration, but it is a folder inside Hudson installation that is dedicated to the job. It can be referenced from within the job through %WORKSPACE% environment variable.
There are ways to use a different workspace location, but that is outside the scope of this overview. The whole SCM part is also optional, you can rely on existing file system, but this is not a good approach, and again, out of scope of this overview.
The Build step
After Hudson checked-out/updated the Workspace with your SVN, comes the building step. Hudson can do Execute Windows Batch Command by default. It can also Invoke Ant by default. (It can also do Maven, but that is not applicable to your situation)
To do other types of builds, you need a Build Wrapper plugin. In your particular case, the MSBuild plugin is probably what you want. I've never used MSBuild, so cannot give you details. Again, if you have a specific question on how to use MSBuild plugin, you should probably make a separate question with specific issues.
So, using either Execute Windows Batch Command or MSBuild plugin, configure your building step.
Running the exe???
This is very vague. You want to start the .exe and then what? Will it quit and you need an exit code? Do you want to see it on the screen? Again, this is very broad, and deserves a separate question (or read existing questions). If you just want to make a call to the .exe, you can configure a second Execute Windows Batch Command step, type there call path\to\yourfile.exe. But most likely you will not see that on screen. Read my answer here, Open Excel on Jenkins CI, on details of launching an .exe from Hudson/Jenkins that would be visible on screen.
Email
If you want a simple email, Hudson Post-Build actions has a way to send an email. For better customization options, you would want Email-Ext plugin. Once again, if you need details on how to use the email-ext plugin, create a new question (after searching existing questions first), as this is too much to cover in one question.
Conclusion
Your requirements are not too high, but Hudson is not a magic tool that will do the work for you. You still need to configure every step of it. And unless you have a Maven based project (which integrate very well with Hudson), a lot of actions will need to be done through the Execute Windows Batch Command and scripting of your own.