BookmarkSubscribeRSS Feed

Data Entry in SAS Visual Analytics 8.3: Part 3, Integrate SAS Viya Jobs with SAS Visual Analytics

Started ‎08-20-2019 by
Modified ‎08-28-2019 by
Views 9,809

One of the most popular question we hear is, is it possible to achieve data entry using SAS Visual Analytics 8.3. In the SAS 9 world, there was a simple answer: include a stored process in your report.

 

Do you think the answer will be the same in the SAS Viya world?

 

In Part 1 of this series, I explain what a SAS Viya Job is. In Part 2, I explain how to create a SAS Viya Job to perform some data entry using SAS Viya. In this last article of the series, I will add an extra layer and integrate the data entry job (quiz) into a Visual Analytics report.

How to integrate SAS Viya Jobs with SAS Visual Analytics?

SAS Visual Analytics (VA) offers different approaches to integrate SAS Viya Jobs into a VA report. Two objects can serve this purpose:

  • Web Content object
  • Data-Driven Content object

Both objects have the ability to define a URL which will display the content of the web page inside the SAS Visual Analytics report. To define the URL within the object options, we need to get the URL of our SAS Viya Job output covered in Part 2. This can be easily achieved in the SAS Job Execution interface.

Get URL of SAS Viya Job

  1. Log in to the SAS Job Execution Web Application http://host:port/SASJobExecution
  2. Navigate to the location where your job is defined
  3. Select the job
  4. Right click and select Properties

     

    xab_DataEntry3_URL.png

    Select any image to see a larger version.
    Mobile users: To view the images, select the "Full" version at the bottom of the page.

     

  5. Expand the Advanced section and copy the Job submit content URL.

     

    xab_DataEntry3_Properties.png

     

This URL can now be pasted in the Options pane for the Web Content or the Data-Driven Content objects.

 

How do you choose between Web Content and Data-Driven Content objects?

 

The answer is quite simple. If you don't need to interact with the data used in the report, the Web Content object is the right option. As soon as you want to get interaction between the data in the report and the job, you should go for the Data-Driven Content object.

 

Here are a few examples of interactions:

  • Use the data from the report to populate input fields of the job
  • Enrich the HTML of the job with the same data as in the report
  • Use the outcome of the job to filter the data in the report
  • Etc...

What you can't do when integrating a job in a report is a direct update of the displayed data. In order to update the underlying data of the report, the CAS table(s) used in the report should be updated.

 

As you know from Part 2, our web page is a quiz that will require interaction from the report viewer; therefore I will use the Data-Driven Content object. If no interaction was needed, we could define the URL option in the Web Content but you don't really need a tutorial for that (more information).

Objective

We will start from where we left our quiz application in Part 2. Using the technique mentioned above, you can retrieve the URL of the job and add this URL to the Options of the Data-Driven Content object.

 

When this is done, we will create a few calculated measures to suit our needs and use the data to enrich the HTML form of the quiz. The Hint button in the form will display the percentage of users who selected a specific answer to the question. So, that means that we will have to update the %html macro and add some extra logic to it.

Let's create the report!

  • Open SAS Visual Analytics http://host:port/SASVisualAnalytics
  • Create a new report based on two data sources: quiz_answers and quiz_programming (recall these are the CAS tables we created in Part 2)
  • Create a join between the two tables using ID and Name variables
  • Create a new Calculated Measure:

     

    xab_DataEntry3_Measure.png

     

  • Change the Aggregation type of the RatioSelected measure to Average
  • Change the Classification type of the ID measure to Category
  • To validate that everything works fine, add a List Table object to the report and assign these data items for columns: Questions, Choices, Selected, Frequency and RatioSelected. The table should look like this one:

     

    xab_DataEntry3_Table.png

     

  • Add a Data-Driven Content object to the report
  • Open the Options pane and paste the URL of the job

     

    xab_DataEntry3_Options.png

     

  • You should see something similar to this

     

    xab_DataEntry3_ReportNoData.png

     

  • Open the Roles pane of the Data-Driven Content object and assign the following roles in this order:
    1. ID
    2. Choices
    3. RatioSelected

We have now a report with two objects but the HTML in the Data-Driven Content object does not get data from the report. We need to adapt the HTML code generated by the Job to collect data from the report and display the data in the HTML.

Adapt the HTML of the Job

In order to collect data from the report, we should integrate two scripts provided by SAS and jQuery (a JS library easing the DOM navigation).

 

The SAS provided scripts can be downloaded from GitHub.

 

The jQuery script can be found here.

 

You can download those files and store them on the web server installed with SAS Viya. The location to store the files is: /var/www/html. The folder is by default only accessible by root user. You should change the rights on the folder to allow users to copy the files to that location. This can be achieved by a system administrator. As soon as the correct rights are set, you can copy the two contentUtil.js and messagingUtil.js to a folder named util and the jquery-3.3.1.min.js to a folder named libs. The needed files are now available to any user who has access to the web server. You can validate it using URLs similar to:

  • http://sasviya01.race.sas.com/util/contentUtil.js
  • http://sasviya01.race.sas.com/util/messagingUtil.js
  • http://sasviya01.race.sas.com/libs/jquery-3.3.1.min.js

The next step will be to adapt the HTML macro defined in the Job. The HTML code generated by the macro should contain:

  • the references to the JavaScript files
  • a call to the function to collect the data from the report
  • a function to manipulate the data and display a table in the html
  • an HTML element to host the table

Here is the updated code:

 

%macro html;
%if %eval(&id > &maxid) %then
%do;
/* Call the quizz summary page */
%html_result;
%end;
%else
%do;
data _null_;
set casuser.questions (where=(ID=&id)) nobs=rows;
file _webout;
by id;
/* Generate the HTML head */
if _n_ = 1 then do;
put '<html lang="en">';
put '<head>';
put '<title>Quizz Programming</title>';
put '<meta charset="utf-8">';
put '<meta name="viewport" content="width=device-width, 
initial-scale=1.0">';
put '<meta author="BIZOUX, Xavier">';
put '<style>';
put 'article {padding-left:20px;}';
put '</style>';
/* Add jquery and the utilities for Data-Driven Content object */
put '<script type="text/javascript" 
src="/libs/jquery-3.3.1.min.js"></script>';
put '<script type="text/javascript" 
src="/util/messagingUtil.js"></script>';
put '<script type="text/javascript" 
src="/util/contentUtil.js"></script>';
put '<script>';
put 'function hint() {
var x = document.getElementById("hint");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}';
/* Define function to handle the data retrieved from 
Data-Driven Content Object */
put 'function DDC(messageFromVA) {
var question = $("#id").val();
var html = "Other users gave the following answers:";
html += "<table>";
messageFromVA.data.forEach(function (d) {
if (d[0] == question) {
html += "<tr><td>" + d[1] + "</td><td>" + 
d[2].toLocaleString(undefined,{style: "percent", 
minimumFractionDigits:2}) +"</td></tr>";
}});
html += "</table>";
$("#superHint").html(html);
}';
/* Add an event listener to define the action 
when the Hint button is pressed */
put 'document.addEventListener("DOMContentLoaded", 
function (event) { hint(); });';
/* Define the action that is executed when the data are received 
from the Data-Driven Content object */
put 'va.messagingUtil.setOnDataReceivedCallback(DDC);';
put '</script>';
put '</head>';
put '<body>';
end;
if first.id then
do;
/* Create the form calling the SAS JobExecution 
and the specific job */
put '<form action="/SASJobExecution/">';
put '<input type="hidden" name="_program" 
value="/gelcontent/Jobs/Quiz">';
put '<input type="hidden" name="id" id="id" value="' id +(-1)'">';
put '<section>';
put '<header>';
put '<h3>Q ' id "/&maxid : " questions '</h3>';
put '</header>';
put '<article>';
end;
put '<br>';
put '<label> <input type="checkbox" name="' Name +(-1) '" value="' 
Correct +(-1) '">' choices +(-1) '</label>';
if last.id then
do;
put '<br><br>';
put '<button type="button" onclick="hint();">Hint</button>';
put '<input type="submit">';
put '<div id="hint"><p>Multiple answers</p>';
put '<div id="superHint"></div>';
put '</div>';
put '</article>';
put '</section>';
put '</form>';
end;
if _n_=rows then do;
put '</body>';
put '</html>';
end;
run;
%end;
%mend;

 

In the code, you can see the lines that were added in blue.

 

When the modifications are done, save the job and move back to the Visual Analytics report.

 

You should now see something like this:

 

xab_DataEntry3_reportWithData.png

Conclusion

Creating data entry using SAS Viya only is an easy task, you can use CAS to store data, build a data entry application using SAS Viya Jobs and integrate it within a VA report.

 

In this example, we've seen how to generate the HTML page using SAS code. The data entry application is quite simple a few checkboxes and buttons. To develop more advanced interfaces, you can separate the SAS code from the HTML code. The SAS Viya job can then become a data provider for your HTML page. It can be used to send data in JSON or XML format. The data are then manipulated in the HTML page and displayed. Separation of concerns is always a better approach for more advanced applications. This makes the applications easier to maintain and to split the development between a SAS programmer and a HTML/web programmer.

 

As discussed in Part 2, you should always have a clear understanding on the impact of your choices. Here are some questions you should ask yourself before starting:

  • How many concurrent users will use the application?
  • What is the best storage for the data: CAS or RDBMS?
  • Is it better to split SAS and HTML coding?
  • Who will maintain the application?

Those questions are quite obvious but they will clearly impact the way the application is developed and how easy it will be to maintain and scale it while in production.

 

Here is a summary of the series:

  1. The basics
  2. Write a Viya Job with a form
  3. Integrate Viya Jobs in SAS Visual Analytics
Comments

Hi @XavierBizoux,

 

Im having issue on authentication of link when shared to a guest and which require a credential login. My objective is to share my work/project to non-sas user as "guest" that no login is require... Im also, used VA to refer and share the link via web content but there's an error of 403. Were already did made changes in the folder authorization level "as a guest". but still I cannot resolved the issue. Can you help why? Is there additional configuration settings that needed to share jobexecution form directly to non-users. Thank you in advance.

Machine authorization errorMachine authorization errorreproduce the quiz from the serverreproduce the quiz from the server

Hi 

 

Sorry for the late answer to your question. 

 

By default Guest access is designed to provide access to SAS Visual Analytics reports. SAS Job Execution requires specific access for Guest users to access it. 

You should add specific Rules into SAS Environment Manager for SASJobExecution. You can find the related entries using the following URI: /jobExecution

 

I've not tested on my environment. So, I can't really tell you which ones should be updated to grant access for Guest user. 

You might want to apply for the Guest user, the same rights as the Authenticated Users. I would nevertheless avoid giving more than Read access to avoid any security issue. 

 

If you need more information or if you need me to investigate further how to set the rights properly, please let me know and I will spend time on it (but it might take a bit of time due to other priorities). 

 

Regards,

 

Xavier

Hi Xavier,

 

Thanks for replying. By the way I already set the folder location accessible to guest same with authenticated users however it does not allow non-sas users to view the jobexecution link which resulting a 403 error upon access.

 

 

Thanks and regards,

 

image.png

@XavierBizoux 

 

Morning Xavier, great article, as with @danilononod I need to be able to share this with guest, I too got the 403 error, I went into Environment manager and changed all but a couple of rules, it got rid of the 403 error but now just says job error. I know my report work for those with access to sas, and the report works for guest but the part of my VA report that kicks off the job doesn't work for guest. is there another management option i need to adjust? The public guest folder is setup properly for access, as our other va reports without any job attached works great. 

 

Rules I adjusted just to test:

jimbobob_0-1653064967409.png

 

new error:

jimbobob_1-1653065035492.png

 

 

Any help you can give would be great.thanks

Hi,

I’ve been looking at your request. The Job execution error might be related to security but on the data side.
I would turn logs on for the job and check if the log contains more information about the cause. I’m not 100% sure that you will get more information as you are running a quest user. I’ve not been able to validate that it works as I don’t have an environment with guest access configured.
You can turn the log on the job directly or passing the _debug option with log and trace as values:
_debug=log,trace

Let me know if that helps.

Regards,

Xavier


Hi Xavier, stuck re-creating the Visual. I have the javascripts saved to the recommended folders and tested it with my browser, and all successfully showed the script details, sample:

Capture.JPG

 

Before updating the the new html code, I ran the job in sas studio and it worked great, no errors. After updating the html code and building the visual: Capture.JPG

 

I am not getting the section on the data driven content that shows what other users selected as answers and when I submit my first question I get an error:Capture.JPG

I clicked on show log and reopened report and here is the log short of the Error saying table already existed, I'm not seeing any other issues:

AS Log

1    %JESBEGIN
                                                           The SAS System


>>> SAS Macro Variables:
 _ACTION=form,prompts,execute
 _ADDJESBEGINENDMACROS=true
 _CASHOST_=AZRSASCASTEST.coastal.local
 _CASHOSTCONT_=AZRSASCASTEST.coastal.local
 _CASPORT_=5570
 _CLIENTNAME=SASJobExecution
 _CONTEXTNAME=SAS Job Execution compute context
 _CSRF=0c961cae-dc54-442a-8d6d-723b261b8e1d
 _DEBUG=log
 _GRAFLOC= 
 _HTUA=
Mozilla/5.0 (Windows NT 10.0  Win64  x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.124 Safari/537.36 Edg/102.0.1245.
44
 _MIGRATED_STP= 
 _OMITJSONLISTING=true
 _OMITJSONLOG=false
 _OMITSESSIONRESULTS=true
 _OMITTEXTLISTING=true
 _OMITTEXTLOG=true
 _OUTPUT_TYPE=html
 _PROGRAM=/Users/jwalker/Quiz
 _REPLAY= 
 _RESULTFILE=_webout.*
 _RMTADDR=10.100.253.230
 _RMTHOST=10.100.253.230
 _SUPPRESS_MVARS= 
 _TMPCAT= 
 _URL=/SASJobExecution/
 _USERLOCALE=en_US
 _VARIABLEFILTER=eq(name,'_STATUS_MESSAGE')
 _VERSION=SASJobExecution Version 2.2.62
 _XFORWARD=10.100.3.5
 SYS_COMPUTE_DATA=/opt/sas/viya/config/data/compsrv/default
 SYS_COMPUTE_JOB_ID=2F5DD491-2B08-D945-9CA7-5EECFAD27C0D
 SYS_COMPUTE_SESSION_ID=236f9e19-3719-41c3-94aa-21681920c773-ses0000
 SYS_COMPUTE_SESSION_OWNER=jwalker
 SYS_JES_JOB_URI=/jobExecution/jobs/08785044-1e82-4e28-b4cb-d22e35509665


2    /* Define macro variables for the parameters defined in the URL */
3    %global id maxid answer01 answer02 answer03 answer04 answer05;
4    
5    /* Define CAS server connection, session and CAS libraries */
6    options cashost="azrsascastest.coastal.local" casport=5570;
7    cas mySession sessopts=(caslib="casuser");
NOTE: The session MYSESSION connected successfully to Cloud Analytic Services azrsascastest.coastal.local using port 5570. The UUID 
      is 3087a34c-bfa7-894a-979f-68469708d201. The user is jwalker and the active caslib is CASUSER(jwalker).
NOTE: The SAS option SESSREF was updated with the value MYSESSION.
NOTE: The SAS macro _SESSREF_ was updated with the value MYSESSION.
NOTE: The session is using 0 workers.
NOTE: 'CASUSER(jwalker)' is now the active caslib.
NOTE: The CAS statement request to update one or more session options for session MYSESSION completed.
8    libname fintech cas caslib="fintech";
NOTE: Libref FINTECH was successfully assigned as follows: 
      Engine:        CAS 
      Physical Name: 3087a34c-bfa7-894a-979f-68469708d201
                                                           The SAS System

9    libname casuser cas caslib="casuser";
NOTE: Libref CASUSER was successfully assigned as follows: 
      Engine:        CAS 
      Physical Name: 3087a34c-bfa7-894a-979f-68469708d201
10   
11   /* Macro invoked at the beginning of the Job execution */
12   %macro init;
13   	%if %symexist(id) and %eval(&id > 0) %then
14   		%do;
15   
16   			/* Call record macro to register the answers */
17   		%record;
18   
19   			/* Increment question id */
20   		%let id = %eval(&id + 1 );
21   		%end;
22   	%else
23   		%do;
24   
25   			/* Code executed when loading the first time */
26   		%let id = 1;
27   			
28   			data casuser.questions;
29   				set fintech.quiz_programming;
30   			run;
31   			proc cas;
32   				table.promote /caslib="casuser" name="questions";
33   			quit;
34   		%end;
35   
36   	/* Define the number of questions */
37   	proc sql noprint;
38   		create table maxid as select max(id) as maxid from casuser.questions;
39   		select maxid into :maxid from maxid;
40   	quit;
41   
42   %mend;
43   
44   /* Macro invoked when last question has been answered */
45   %macro finish;
46   	%if %eval(&id > &maxid) %then
47   		%do;
48   			/* Generate the data set to be loaded into the Global CASLib used for reporting */
49   			data casuser.toLoad;
50   				set casuser.questions (drop= questions choices hint justification);
51   				userid = "&sysuserid";
52   				datetime = datetime();
53   				format datetime datetime16.;
54   			run;
55   			/* Load data into the CASLib used for reporting and perform some cleanup activities */
56   			proc cas;
57   				table.tableExists result=res/caslib='fintech' name='quiz_answers';
58   				
59   				if res.exists > 0 then
60   				do;
61   					datastep.runcode result=dsResult /code="data fintech.quiz_answers (append=yes); set casuser.toLoad; run;";
62   				end;
63   				else
                                                           The SAS System

64   				do;
65   					table.promote / caslib='casuser' name='toLoad' target='quiz_answers' targetlib='fintech';
66   					table.promote / caslib='fintech' name='quiz_answers';
67   				end;
68   				table.save / caslib='fintech' name='quiz_answers' table={caslib='fintech' name='quiz_answers'} replace=true;
69   				table.dropTable / caslib='casuser' name='questions';
70   				table.deleteSource / caslib='casuser' source='questions';
71   				table.dropTable / caslib='casuser' name='toLoad';
72   				table.deleteSource / caslib='casuser' source='toLoad';
73   			quit;
74   			/* Terminate the CAS session */
75   			cas mySession terminate;
76   		%end;
77   %mend;
78   
79   /* Macro invoked to record the answers */
80   %macro record;
81   	proc cas;
82   		questionsTbl.name="questions";
83   
84   		do i=1 to 5 by 1;
85   			name_i=put(i, z2.);
86   			varName='Answer'||name_i;
87   
88   			if symget(varName) > "" then
89   				do;
90   					questionsTbl.where="&id = id and name ='"|| varName ||"'";
91   					table.update / table=questionsTbl set={{var='selected', value="1"}};
92   				end;
93   		end;
94   	quit;
95   
96   %mend;
97   
98   /*Macro generating the html pages */
99   %macro html;
100  %if %eval(&id > &maxid) %then
101  %do;
102  /* Call the quizz summary page */
103  %html_result;
104  %end;
105  %else
106  %do;
107  data _null_;
108  set casuser.questions (where=(ID=&id)) nobs=rows;
109  file _webout;
110  by id;
111  /* Generate the HTML head */
112  if _n_ = 1 then do;
113  put '<html lang="en">';
114  put '<head>';
115  put '<title>Quizz Programming</title>';
116  put '<meta charset="utf-8">';
117  put '<meta name="viewport" content="width=device-width,
118  initial-scale=1.0">';
119  put '<meta author="BIZOUX, Xavier">';
120  put '<style>';
121  put 'article {padding-left:20px;}';
                                                           The SAS System

122  put '</style>';
123  /* Add jquery and the utilities for Data-Driven Content object */
124  put '<script type="text/javascript"
125  src="/libs/jquery-3.3.1.min.js"></script>';
126  put '<script type="text/javascript"
127  src="/util/messagingUtil.js"></script>';
128  put '<script type="text/javascript"
129  src="/util/contentUtil.js"></script>';
130  put '<script>';
131  put 'function hint() {
132  var x = document.getElementById("hint");
133  if (x.style.display === "none") {
134  x.style.display = "block";
135  } else {
136  x.style.display = "none";
137  }
138  }';
139  /* Define function to handle the data retrieved from
140  Data-Driven Content Object */
141  put 'function DDC(messageFromVA) {
142  var question = $("#id").val();
143  var html = "Other users gave the following answers:";
144  html += "<table>";
145  messageFromVA.data.forEach(function (d) {
146  if (d[0] == question) {
147  html += "<tr><td>" + d[1] + "</td><td>" +
148  d[2].toLocaleString(undefined,{style: "percent",
NOTE: The quoted string currently being processed has become more than 262 bytes long.  You might have unbalanced quotation marks.
149  minimumFractionDigits:2}) +"</td></tr>";
150  }});
151  html += "</table>";
152  $("#superHint").html(html);
153  }';
154  /* Add an event listener to define the action
155  when the Hint button is pressed */
156  put 'document.addEventListener("DOMContentLoaded",
157  function (event) { hint(); });';
158  /* Define the action that is executed when the data are received
159  from the Data-Driven Content object */
160  put 'va.messagingUtil.setOnDataReceivedCallback(DDC);';
161  put '</script>';
162  put '</head>';
163  put '<body>';
164  end;
165  if first.id then
166  do;
167  /* Create the form calling the SAS JobExecution
168  and the specific job */
169  put '<form action="/SASJobExecution/">';
170  put '<input type="hidden" name="_program"
171  value="/gelcontent/Jobs/Quiz">';
172  put '<input type="hidden" name="id" id="id" value="' id +(-1)'">';
173  put '<section>';
174  put '<header>';
175  put '<h3>Q ' id "/&maxid : " questions '</h3>';
176  put '</header>';
177  put '<article>';
178  end;
                                                           The SAS System

179  put '<br>';
180  put '<label> <input type="checkbox" name="' Name +(-1) '" value="'
181  Correct +(-1) '">' choices +(-1) '</label>';
182  if last.id then
183  do;
184  put '<br><br>';
185  put '<button type="button" onclick="hint();">Hint</button>';
186  put '<input type="submit">';
187  put '<div id="hint"><p>Multiple answers</p>';
188  put '<div id="superHint"></div>';
189  put '</div>';
190  put '</article>';
191  put '</section>';
192  put '</form>';
193  end;
194  if _n_=rows then do;
195  put '</body>';
196  put '</html>';
197  end;
198  run;
199  %end;
200  %mend;
201  
202  /*Macro generating the summary page */
203  %macro html_result;
204  	data _null_;
205  		length cssClass $200;
206  		set casuser.questions nobs=rows;
207  		file _webout;
208  		by id;
209  		/* Generate the HTML head */
210  		if _n_=1 then
211  			do;
212  				put '<html lang="en">';
213  				put '<head>';
214  				put '<title>quiz Programming</title>';
215  				put '<meta charset="utf-8">';
216  				put
217  					'<meta name="viewport" content="width=device-width, initial-scale=1.0">';
218  				put '<meta author="BIZOUX, Xavier">';
219  				put '<style>';
220  				put 'article {padding-left:20px;}';
221  				put '.valid {display:block; background-color: lightgreen; width:400px;}';
222  				put '.invalid {display:block; background-color: red; width:400px;}';
223  				put '</style>';
224  				put '</head>';
225  				put '<body>';
226  			end;
227  		/* Generate the card for each question */
228  		if first.id then
229  			do;
230  				put '<section>';
231  				put '<header>';
232  				put '<h3>Q ' id "/&maxid : " questions '</h3>';
233  				put '</header>';
234  				put '<article>';
235  			end;
236  
                                                           The SAS System

237  		if correct=1 then
238  			cssClass=' class="valid" ';
239  		else
240  			cssClass=' class="invalid" ';
241  		put '<label ' cssClass '>';
242  		put;
243  
244  		if selected=1 then
245  			do;
246  				put '<input type="checkbox" checked disabled>';
247  			end;
248  		else
249  			do;
250  				put '<input type="checkbox" disabled>';
251  			end;
252  		put choices +(-1) '</label>';
253  
254  		if last.id then
255  			do;
256  				put '</article>';
257  				put '<br>';
258  				put '<article>';
259  				put '<header> <h4>Answer</h4> </header>';
260  				put '<p>' justification '</p>';
261  				put '</article>';
262  				put '<br>';
263  				put '</section>';
264  			end;
265  
266  		if _n_=rows then do;
267  			put '</body>';
268  			put '</html>';
269  		end;
270  	run;
271  
272  %mend;
273  
274  /* Call the different macros */
275  %init;

NOTE: Running DATA step in Cloud Analytic Services.
NOTE: The DATA step will run in multiple threads.
NOTE: There were 10 observations read from the table QUIZ_PROGRAMMING in caslib Fintech.
NOTE: The table questions in caslib CASUSER(jwalker) has 10 observations and 8 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      user cpu time       0.00 seconds
      system cpu time     0.00 seconds
      memory              1409.87k
      OS Memory           26148.00k
      Timestamp           07/18/2022 04:02:48 PM
      Step Count                        7  Switch Count  2
      Page Faults                       0
      Page Reclaims                     82
      Page Swaps                        0
      Voluntary Context Switches        68
      Involuntary Context Switches      0
      Block Input Operations            0
                                                           The SAS System

      Block Output Operations           0
      


NOTE: Active Session now MYSESSION.
ERROR: The target table questions of the promotion already exists. Please specify a different name.
ERROR: The action stopped due to errors.

NOTE: PROCEDURE CAS used (Total process time):
      real time           0.00 seconds
      user cpu time       0.01 seconds
      system cpu time     0.00 seconds
      memory              10658.03k
      OS Memory           35980.00k
      Timestamp           07/18/2022 04:02:48 PM
      Step Count                        8  Switch Count  0
      Page Faults                       0
      Page Reclaims                     1166
      Page Swaps                        0
      Voluntary Context Switches        10
      Involuntary Context Switches      0
      Block Input Operations            0
      Block Output Operations           0
      

NOTE: Table WORK.MAXID created, with 1 rows and 1 columns.

NOTE: PROCEDURE SQL used (Total process time):
      real time           0.03 seconds
      user cpu time       0.01 seconds
      system cpu time     0.01 seconds
      memory              5467.50k
      OS Memory           31268.00k
      Timestamp           07/18/2022 04:02:48 PM
      Step Count                        9  Switch Count  0
      Page Faults                       0
      Page Reclaims                     315
      Page Swaps                        0
      Voluntary Context Switches        42
      Involuntary Context Switches      0
      Block Input Operations            0
      Block Output Operations           136
      

276  %html;
NOTE: The quoted string currently being processed has become more than 262 bytes long.  You might have unbalanced quotation marks.

NOTE: The file _WEBOUT is:
      Filename=_webout.html,
      URI path=/files/files/68090848-ba38-442d-80b3-bf9df3c73b3c,
      File Identifier=68090848-ba38-442d-80b3-bf9df3c73b3c,
      Content Type=text/html,
      Parent URI=/jobExecution/jobs/08785044-1e82-4e28-b4cb-d22e35509665,
      Encoding=UTF-8,RECFM=V,LRECL=32767,
      File Size (bytes)=0,
      Last Modified=18Jul2022:16:02:48,
      Create Time=18Jul2022:16:02:48

                                                           The SAS System

NOTE: 45 records were written to the file _WEBOUT.
      The minimum record length was 4.
      The maximum record length was 376.
NOTE: There were 4 observations read from the data set CASUSER.QUESTIONS.
      WHERE ID=1;
NOTE: DATA statement used (Total process time):
      real time           0.32 seconds
      user cpu time       0.06 seconds
      system cpu time     0.01 seconds
      memory              912.50k
      OS Memory           26400.00k
      Timestamp           07/18/2022 04:02:48 PM
      Step Count                        10  Switch Count  0
      Page Faults                       0
      Page Reclaims                     623
      Page Swaps                        0
      Voluntary Context Switches        92
      Involuntary Context Switches      1
      Block Input Operations            0
      Block Output Operations           8
      

277  %finish;
278  %JESEND

 

So found one issue that I fogot to do, when replacing the html from part two with the new html from part three forgot to change the line with the gel content to my directory where the job is  

171  value="/gelcontent/Jobs/Quiz">';

So I can submit the quiz now with now apparent errors however the section in the data driven content, still doesn't show what other users responses are and I now get new errors:  

NOTE: Active Session now MYSESSION.
NOTE: Cloud Analytic Services saved the file quiz_answers.sashdat in caslib Fintech.
{caslib=Fintech,name=quiz_answers.sashdat}
NOTE: Cloud Analytic Services dropped table questions from caslib CASUSER(jwalker).

ERROR: The source data questions could not be removed from caslib CASUSER(jwalker) of Cloud Analytic Services.
ERROR: The action stopped due to errors.

NOTE: Cloud Analytic Services dropped table toLoad from caslib CASUSER(jwalker).

ERROR: The source data toLoad could not be removed from caslib CASUSER(jwalker) of Cloud Analytic Services.
ERROR: The action stopped due to errors.

 Not sure if it an issue? Also is it supposed to look like i have five contents inside each other, each time I answer a question looks like its opening up a new data driven object?

Capture.JPG

Hi, 

 

Sorry for the late answer, I was off for a few weeks enjoying summertime. 

Regarding the troubles you are facing, I'm not sure about the issue but you can check the content of the casuser.questions in SAS Studio. The table has been promoted and should be available across sessions. You can check the content of the table after assigning the casuser libname. 

 

cas mySession;

libname casuser cas caslib="casuser";

 

If the table is empty, you may have trouble earlier in the SAS code. If the table is available, you can try to execute the last part of the code which should "load data into the CASLib used for reporting and perform some cleanup activities". Let me know if that works in SAS Studio. 

If not, please send me the resulting log. 

 

Thanks @XavierBizoux , so data is available to report on, and the part of capturing the data in the tables is working, so at least i know that works which is what I really care about. I'm sure I'll have more question now that I am trying to build my own. Thanks for getting back to me.

Version history
Last update:
‎08-28-2019 04:18 AM
Updated by:
Contributors

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started