BookmarkSubscribeRSS Feed
BernardTanSg
Fluorite | Level 6

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

12 REPLIES 12
jacksmith1
Fluorite | Level 6

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.

JosvanderVelden
SAS Super FREQ
@jacksmith1 is correct. The SAS Viya for Learners (VFL) environment does not allow running the %include statement. This is due to security measures implemented by the VFL administrators. You'll have to use code that doesn't include a %include statement. For some courses (ex DMML35) the demonstration programs available in VFL have been revised and start with vfl_. Which course are studying with VFL?
BernardTanSg
Fluorite | Level 6

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 ?

2024-02-07_08-45-16.png

BernardTanSg
Fluorite | Level 6

BernardTanSg_0-1707362555862.png

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

 

 

JosvanderVelden
SAS Super FREQ
SAS Viya for Learners (VFL) is based on Viya 3.5 so you should use the sample code provided here: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/jobexecug/n0t91q5lsc2b8qn14fd0cgbmylr8.htm#p0....
I have been able to execute the hello world sample on VFL without issue. Can you try with the code provided on the 9.4_3.5 sample page?
Quentin
Super User

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.

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
BernardTanSg
Fluorite | Level 6

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

BernardTanSg_0-1707438966740.png

 

My HTML form screen

BernardTanSg_1-1707438995268.png

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

 

 

Quentin
Super User

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.

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
JosvanderVelden
SAS Super FREQ
I just verified and was able to reproduce the error on a different VFL server. I don't have access to the server you areb using. It seems that it will work on some servers and not on others in the VFL server cluster. I suggest you open a VFL technical support ticket by sending an email to sasviyaforlearners@sas.com. In the email send a link to this thread and place me in copy: jos.van.der.velden@sas.com. Don't forget to mention the vflserverurl. In my case I've tested with the following URLs: https://v4e074.vfe.sas.com/SASStudioV/ (doesn't work) and https://v4e042.vfe.sas.com/SASStudioV/ (works fine). You probably don't have access when you use these URLs. The VFL administrators might have to restart some services on your server.
Quentin
Super User

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!

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
BernardTanSg
Fluorite | Level 6

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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 12 replies
  • 1149 views
  • 12 likes
  • 5 in conversation