Hi
I am a student learner and i just started to Viya.
I tried to create a job in viya with some codes from the help.
SAS code
==========
* Declare input parameter;
%global MYNAME;
* Write the custom HTML to _webout;
data _null_;
file _webout;
put '<!DOCTYPE html>';
put '<html lang="en">';
put '<head><title>Hello World!</title></head>';
put '<body role="main">';
put "<h1>Hello %sysfunc(htmlencode(&MYNAME))!</h1>";
put '</body>';
put '</html>';
run;
HTML form
==========
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hello World 11</title>
<link rel="stylesheet" href="/SASJobExecution/theme">
</head>
<body role="main" class="jobexec_body">
<form class="jobexec_form" action="/SASJobExecution/" target="_tab">
<input type="hidden" name="_program" value="$PROGRAM$"/>
<input type="hidden" name="_action" value="wait,execute"/>
<input type="hidden" name="_output_type" value="html"/>
1<div class="jobexec_sample_header">SAS<sup>®</sup> Job Execution</div>
2<h1 class="jobexec_sample_name">Hello World 11</h1>
<p>
This sample uses a DATA Step with simple PUT statements to create the output.
</p>
<hr/>
<br/>
3<label for="myname">Specify a name for the greeting:</label>
<input type="text" name="myname" id="myname" value="World" required
class="jobexec_sample_input_text"/>
<br/>
<br/>
<hr/>
4<input type="submit" value="Run code" class="jobexec_sample_input_submit"/>
<input type="checkbox" name="_debug" id="_debug" value="log"
class="jobexec_sample_input_checkbox"/>
<label for="_debug">Show SAS Log</label>
</form>
</body>
</html>
I can preview the form when i run the code. However, when i clicked on the "run code" button, the output gave the following error
"
Job Error
Program error.
The %INCLUDE statement will not be executed due to a LOCKDOWN violation.
"
May i know what is mistake in the code that is causing this error ? i wish to start with a simple hello world to understand how to associate a form with the SAS code. thank you
Hello!
The lockdown violation error likely stems from the %INCLUDE
statement in your code. Viya's security policies may restrict external file inclusion. Avoid using %INCLUDE
and incorporate necessary code directly. Check permissions and consult SAS support if needed.
The code you posted does not contain a %INCLUDE statement; please post the part of your code that does.
Hi
there is no %Include in the code that i am testing. I have create a SAS job definition and i am trying to associate a HTML form to the code as
described here
https://documentation.sas.com/doc/en/pgmsascdc/v_041/jobexecug/p0dr6nvk53cw7gn15a8wcx7gpakn.htm
Could it be something that could be inherent to the backend engine of the SAS job ?
This is the error. i could not locate any line that suggest there is an %INCLUDE statement.
hope to seek some help please. Thank you
If you click the "show log" button on that error message screen, can you copy the full log and post it here? It should show and %INCLUDE statement somewhere. It's possible that SAS is using an %INCLUDE statement in some automatically generated code, even if your user-written code doesn't have an %INCLUDE statement. But it's also possible that SAS will hide the log from the the automatically code, which is an unfortunate design choice that they sometimes make.
thanks @JosvanderVelden and @Quentin for your replies
oh dear.... i have tried that new version too and many other job examples posted in the communities.
however, when i run all the examples , every run gave me the same error message.
This is my code screen
My HTML form screen
this is the video when i run the script
I do not know whether do i have to change anything to the script though to avoid this error.
Thank you
That's a shame. Looks like the "show log" options are not actually showing you the SAS log. I guess it's possible that your code never actually runs. Sorry, I'm not familiar with Viya. Hopefully someone else can help.
Wow @JosvanderVelden that sort of testing, follow-up, and personal support is a great example of why SAS employee participation in communities.sas.com is so valuable to the SAS community. Thank you!
Thank you very much @JosvanderVelden and @Quentin for your attention.
I'll reach out to sasviyaforlearners as recommended to explore potential solutions for resolving this error.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.