@AhmedAl_Attar It would be still part of SAS Viya & the Job Execution
@AhmedAl_Attar Thanks for your help, I could understand this concept now. However I do have the few questions which I believe you can answer it.
a) I already looked into the article including the embedded HTML code which you shared with me on yesterday. However when I executed those codes in my SAS Studio I observed that values are not loading in the dropdown. I have asked this question to @XavierBizoux in the comments section of that article. You can also see what I have executed. May be I'm missing something but I'm not certain what I have missed.
b) How would the libname get resolved from the below line if I change the libname?
<select name="var_product" id="var_product" data-colname="product" data-library="IFRSPROD" data-table="Manufacturing"></select>
Below scripts will take care of it?
<script src="/SASJobExecution/resources/sap/ui/thirdparty/jquery.js"></script> <script src="/SASJobExecution/resources/dynamic.min.js"></script>
c) See my response to @Kurt_Bremser today to understand my existing HTML code. Once I identified the working solution for SAS data set's values loaded into the HTML Widget ,should I embedded this version into original HTML code which I shown to @Kurt_Bremser ?
I'll try my best to answer your questions
Assuming you are using the same version of SAS Viya as @XavierBizoux was using for his article (3.4/3.5)
a) You'll need to make sure to follow the article's steps to the teeth in order to get it working. I would recommend building a dummy Job replicating what had done. His GitHub repository has all the files you need, just copy and paste 😉
b)
data-library="IFRSPROD"
You'll need to ask your SAS Viya Administrator to add this library reference to the auto-assigned libraries at start-up, and set the correct permissions to allow users such as yourself, access and read tables from this library.
I would think these two JavaScripts scripts provide the needed HTML Front-End communication to the SAS Viya Back-End and translating the extended Tag attributes such as "data-uses=" into SAS code.
c) I recommend you use something that can be supported by SAS Tech Support, and follows the guidance provided by this SAS documentation: SAS® Job Execution Web Application 2.2: User’s Guide
So in case you encounter issues, they'll be able to step-in and help you. One other issue you need to pay attention to, is the number of unique values you returning to the Web Page! Data pagination is a way to resolve this issue.
Hope this help
@AhmedAl_Attar thank you for the insights. It is really helpful. I've executed the HTML and SAS file from GitHub repository. I see that one XML file is also available in the GitHub. If I want to execute that XML file, I'm not sure where to place that XML file in SAS studio and execute. I don't think it is an SAS Viya version issue Any help?
The XML file is for the Task Prompt, not the HTML Form.
Xavier used the same repository for both articles.
Currently, I don't have access to a Viya deployment, therefore I cannot try out the example and tell you why/where you are having issue.
Last time when I followed all the steps, and tried the example, it worked without any issue! Therefore, I would suggest you
Not sure what else I can help with
@AhmedAl_Attar I tried to follow the instructions as mentioned in the article. His code is working fine if I use task prompts but when I use HTML code the dropdowns are not loading with values. Were you able to guess what would be likely cause for that issue.
SAS Studio release which I have is 5.2 and the SAS Viya release is V.03.05. If this is due to SAS Viya version issue and if you are aware of alternate solution please let me know. Thanks for the support so far.
It looks like for HTML Page in Viya 3.5 you'll have to do it manually!
Have a look at page 72 of this guide
This paper https://support.sas.com/resources/papers/proceedings14/1738-2014.pdf has some sample SAS code that generates HTML tags from a SAS data set that could serve as guide for you.
Widget dependencies in terms of Hide/Display for Cascading Prompts will have to be implemented by custom JavaScript, that you develop or try to find through searching the internet.
@AhmedAl_Attar Thank you for the extended support. Those documents are helpful. It is evident that my task is not going to be easy. I just executed the following program in my SAS studio. I found this program in page 10 and 11 from https://support.sas.com/resources/papers/proceedings14/1738-2014.pdf
proc stream outfile=_webout quoting=both; BEGIN <html> <body><title>Select Products</title><body> %let rc =%sysfunc(dosubl( proc sql noprint; Figure 8. First Attempt to Include SAS Code in a SAS Server Page 11 select distinct '<input type="checkbox" name="product" value="' ||strip(product) ||'">' ||strip(product) into:checkboxes separated by '<br>' from sashelp.shoes; quit; )); /* End both the DOSUBL function call and the %SYSFUNC macro function */ &checkboxes </body> </html> ;;;; run;
Error which I got is, 'ERROR: No logical assign for filename _WEBOUT.'
81 proc stream outfile=_webout quoting=both; 82 BEGIN 83 <html> ERROR: No logical assign for filename _WEBOUT. 84 <body><title>Select Products</title><body> 85 %let rc =%sysfunc(dosubl( 86 proc sql noprint; 87 Figure 8. First Attempt to Include SAS Code in a SAS Server Page 88 11 89 select distinct 90 '<input type="checkbox" name="product" value="' 91 ||strip(product) 92 ||'">' ERROR 180-322: Statement is not valid or it is used out of proper order. NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements. NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 93 ||strip(product) 94 into:checkboxes separated by '<br>' 95 from sashelp.shoes; 96 quit; 97 )); /* End both the DOSUBL function call and the 98 %SYSFUNC macro function */ 99 &checkboxes WARNING: Apparent symbolic reference CHECKBOXES not resolved. NOTE: PROCEDURE STREAM used (Total process time):
Other question is, I already wrote the HTML for the webpage. Only issue now is, to identify the right SAS code or HTML code (I wish to embed this version into my HTML code which I shown to @Kurt_Bremser ) to fetch data from SAS datasets and load the values in the prompts.
"Error which I got is, 'ERROR: No logical assign for filename _WEBOUT."
The _webout is a special Socket I/O File reference that the JobExecution Server assigns, allow SAS sessions writing directly to browser response.
From within your SAS Studio session, If you were to assign this file reference (_webout) to any dummy file on your file-system, the data step would work as expected.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.