BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
acordes
Rhodochrosite | Level 12

 

I cannot figure out how to use the VA's parameters in the prompt's dataset as filters. 

Here is my attempt. 

The macro variable var_model is associated with the last combobox' choice in the xml prompt and once submitted should become assigned. 

 

I thought about triggering 2 times the execute _action. But doing so gives an error. 

 

 

%global var_model make type;

cas mySession sessopts=(caslib=casuser timeout=1800 locale="en_US");
caslib _all_ assign;

cas mySession sessopts=(caslib="dev");
libname mycas cas caslib='dev';

%if ^%symexist(var_model) %then %do;

proc casutil;
	droptable casdata="cars2" quiet;
run;

/* data mycas.cars2(promote=yes); */
	data work.cars2;
	set mycas.cars;
	where make="&make" and type="&type";
run;

%end;

%if %symexist(var_model) %then %do;
/* proc print data=mycas.cars2; */
	proc print data=work.cars2;
	where model="&model";
run;

Captura de pantalla 2025-07-18 180202.pngCaptura de pantalla 2025-07-18 180115.png

1 ACCEPTED SOLUTION

Accepted Solutions
XavierBizoux
SAS Super FREQ

Hi @acordes ,

The util.js files are there to help building web pages. They are not mandatory to building web pages in the DDC object. You can use the JavaScript in this documentation to populate prompts of the first job with information from the VA report. You can then submit the first job and stay on the same page as described in this article. In your case, you will display the result but take specific actions using JavaScript when the first job ends execution. You can then populate other prompts based on the results from the first job. As soon as the prompts are populated, you can then execute the second job. 

In that situation, you don't use iFrames and you should not need to adapt the security on the platform. 

I can most probably try to write an article around this topic in the future but it will not be before Septembre/October timeframe. 

Please let me know if that would help. 

Regards, 

Xavier

Xavier BIZOUX
Advisory Technical Architect ● Global Enablement and Learning
Technology Transfer and Governance, R&D

View solution in original post

6 REPLIES 6
acordes
Rhodochrosite | Level 12

Hi @XavierBizoux, I'm trying to insert a _program statement in the XML. But I'm not sure if it's a promising approach. 

 

And I've found the following article that could be key to achieving what I pretend. 

https://documentation.sas.com/doc/en/jobexeccdc/v_004/jobexecug/n1jj26acxr0ictn1riqgxoxrcehu.htm#p16...  

XavierBizoux
SAS Super FREQ

Hi @acordes ,

I'm not sure to understand what you mean by inserting a _program statement in the XML. Could you please give a bit more context about what you are trying to achieve? 

Regards, 

Xavier 

Xavier BIZOUX
Advisory Technical Architect ● Global Enablement and Learning
Technology Transfer and Governance, R&D
acordes
Rhodochrosite | Level 12

Hi @XavierBizoux, due to current setup restrictions I can work only with Job Contents or URLs appointing a job from Visual Analytics, DDC solutions are at this moment out of scope. 

As far as I've noticed, a job content cannot carry parameters nor establish actions with other VA objects. Therefore the most promising solution in my opinion is to create a job with a prompt from Job Execution and link to it with an URL call from a list table or cross table in VA. 

What I'm getting done is the following: 

  1. pass parameters through the URL link and use them to pre-filter a table in job1
  2. prompts, execute job2 by using the (hard-coded) table from the prior job to create a form letting the user choose a root cause for failure, select an alternative root cause and submit the job
  3. do something code-wise with the parameters from the prompts' selection

 

But the missing link is to execute the job1 prior to the job2. Both jobs work independently but not in a sequential manner. I need the first job to pre-filter the table according to the selected row from VA from where I call the job via URL. 

If I do not succeed in doing so I have 2 alternatives:

  1. to call 2 jobs from VA, each for 1 job
  2. or to build the prompt upon the unfiltered table requiring the report user to mimic the filters from the selected row therefore overloading the prompts. 

I've opened a related post explaining the desired approach.

https://communities.sas.com/t5/SAS-Programming/job-exceution-Waiting-for-a-job-to-finish-before-laun... 

 

 

 

XavierBizoux
SAS Super FREQ

Hi @acordes 

I'm not sure I fully understand why you can't use a DDC object. If you want, you can define a job URL in the DDC object and it will allow you to use JavaScript in your HTML form to retrieve the values passed by the VA report to the DDC object. 

 

Besides that, I think the solution to your problem can be the job chaining macros described here

 

Let me know if you have questions. 

 

Regards, 

 

Xavier

Xavier BIZOUX
Advisory Technical Architect ● Global Enablement and Learning
Technology Transfer and Governance, R&D
acordes
Rhodochrosite | Level 12

Thanks @XavierBizoux 

It's been confusing what I've said about DDC. I cannot use so far util.js and those helper files that come along with many of your provided solutions combining jobs and DDC. 

I can use the DDC object with the URL to the job, but as pop-ups are forbidden and I'm not sure if I can allow by my own, I do not come across the submit command of the prompt.

 

My best attempt was just about chaining the jobs. 

But the second job with the prompt is not displayed. 

As I had stated before, the first job executes well leaving a filtered table which populates the prompts inputs. Both jobs work well in an isolated way. 

But the chaining fails because I cannot manage to trigger the second job with the prompts being displayed. 

For the query_value line I've tried adding "_action"="form, prompts, execute" but nothing works for me.  

 

*  Execute the second job;

%let QUERY_VALUE=FORM('_program'='/folder/ok/proc1/shutdown/jobs/test sequential run v2' 'make'="&make" 'type'="&type");

*;
*  The macro waits for the job to finish execution because _action=background is not
*  specified.  
*;

%jobexec_run(baseurl=&SERVICESBASEURL,
             in=&QUERY_VALUE,
             jobid_varname=J2JOBID)

%if (&_JOBRUN_RC eq 0) %then %do;
  %put NOTE: You can view the job execution object at /jobExecution/jobs/&J2JOBID;
  %put NOTE: You can view the job output at /SASJobExecution/?_jobexec=/jobExecution/jobs/&J2JOBID;
%end;
%else %do;
  %put ERROR: Problem running the job. &=_JOBRUN_RC  &=_STATUS_MESSAGE;
%end;

 

XavierBizoux
SAS Super FREQ

Hi @acordes ,

The util.js files are there to help building web pages. They are not mandatory to building web pages in the DDC object. You can use the JavaScript in this documentation to populate prompts of the first job with information from the VA report. You can then submit the first job and stay on the same page as described in this article. In your case, you will display the result but take specific actions using JavaScript when the first job ends execution. You can then populate other prompts based on the results from the first job. As soon as the prompts are populated, you can then execute the second job. 

In that situation, you don't use iFrames and you should not need to adapt the security on the platform. 

I can most probably try to write an article around this topic in the future but it will not be before Septembre/October timeframe. 

Please let me know if that would help. 

Regards, 

Xavier

Xavier BIZOUX
Advisory Technical Architect ● Global Enablement and Learning
Technology Transfer and Governance, R&D

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 811 views
  • 1 like
  • 2 in conversation