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;
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
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.
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
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:
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:
I've opened a related post explaining the desired approach.
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
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;
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
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.