ZOS USS from APACHE

26 views
Skip to first unread message

Michael Rooney

unread,
Dec 7, 2015, 3:31:48 PM12/7/15
to Google Visualization API
Hi ,
   I'm running from the IBM ZOS Unix system server and can issue the sample linechart successfully if I hard code values as see below.  If I add a REXX do loop to the data and build the addrows, My source returns a chart without data.  If I HARD code the say statements, it works and I can see it in the browser.  I'm reading in a file via readfile and parsing the values via rexx.   Any ideas ?  I  

        Thanks in advance !
           Michael                                                            


----  Native output from rexx (showing the rexx variable ARE being populated on the mainframe) ----

 SYccc  E    /tmp/cccccc 15:18:33.915861.stdout.ishell Line 00000000 Col 001 080
 Command ===>                                                  Scroll ===> PAGE
***********                   *** Top of Data **********************************
Content-typ   Exit status=0   t=UTF-8                                          
                                                                               
<!DOCTYPE HTML>                                                                
<title> TEST PIEL</title>                                                      
<html>                                                                         
<head>                                                                         
 <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"><
 <script type="text/javascript">                                               
    google.charts.load('current', {packages: Ý'corechart'¨});                  
    google.charts.setOnLoadCallback(drawVisualization);                        
    function drawVisualization() {                                             
      // Define the chart to be drawn.                                         
      var dataTable = new google.visualization.DataTable();                    
      dataTable.addColumn('datetime', 'Time of Day');                          
      dataTable.addColumn('number', 'Trans per Min.');                         
      dataTable.addColumn('number', 'Trans per hour');                         
      dataTable.addRows(Ý                                                      
Ýnew Date("01/02/2015 16:01"), 5,10¨,                                          
Ýnew Date("01/02/2015 16:02"), 15,3¨,                                          
Ýnew Date("01/02/2015 16:03"), 19,4¨);
                                         
      // Instantiate and draw the chart.                                       
var formatter = new google.visualization.DateFormat({pattern: 'yyyy/MM/dd'});  
    var options = {                                                            
          title: 'Rate the Day on a Scale of 1 to 10',                         
          width: 900,                                                          
          height: 500,                                                         
          hAxis: {                                                             
            format: 'yyyy mm dd hh ss',                                        
            gridlines: {count: 15}                                             
          },                                                                   
          vAxis: {                                                             
            gridlines: {color: 'none'},                                        
            minValue: 0                                                        
-----------------------------------------------------------------------------------------------



------------------------------   Source browser output ---------------------------------

<!DOCTYPE HTML>

<title> TEST PIEL</title>

<html>

<head>

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>

<script type="text/javascript">

google.charts.load('current', {packages: ['corechart']});

google.charts.setOnLoadCallback(drawVisualization);

function drawVisualization() {

// Define the chart to be drawn.

var dataTable = new google.visualization.DataTable();

dataTable.addColumn('datetime', 'Time of Day');

dataTable.addColumn('number', 'Trans per Min.');

dataTable.addColumn('number', 'Trans per hour');

dataTable.addRows([

// Instantiate and draw the chart.

var formatter = new google.visualization.DateFormat({pattern: 'yyyy/MM/dd'});

var options = {

title: 'Rate the Day on a Scale of 1 to 10',

width: 900,

height: 500,

hAxis: {

format: 'yyyy mm dd hh ss',

gridlines: {count: 15}

},

vAxis: {

gridlines: {color: 'none'},

minValue: 0

}

};

var chart = new google.visualization.LineChart(document.getElementById('visualization'));

chart.draw(dataTable, {curveType: "function"});

}

</script>

</head>

<body>

<!-- Identify where the chart should be drawn. -->

<div id="visualization"/>

</body>

</html>

------------------------------------------- / end browser




---------------- REXX source code ----


say 'Content-type: text/html;charset=UTF-8'                       
                                                                  
/* Next line - very important */                                  
/* It separates the HTTP header from the body of the reponse */   
/* Do no delete it */                                             
                                                                  
say ''                                                            
                                                                  
                                                                  
say'<!DOCTYPE HTML> '                                             
say'<title> TEST PIEL</title>'                                    
say'<html>'                                                       
say'<head>'                                                       
say' <script type="text/javascript" src="'loadit'"></script>'     
say' <script type="text/javascript">'                             
say"    google.charts.load('current', {packages: Ý'corechart'¨});"
say"    google.charts.setOnLoadCallback(drawVisualization);"      
say"    function drawVisualization() {"                           
say"      // Define the chart to be drawn. "                      
say"      var dataTable = new google.visualization.DataTable();"  
say"      dataTable.addColumn('datetime', 'Time of Day'); "       
say"      dataTable.addColumn('number', 'Trans per Min.'); "      
say"      dataTable.addColumn('number', 'Trans per hour'); "      
say"      dataTable.addRows("'AD'x                                
Do cnt = 1 to nd.0                                                
 If cnt ¬= nd.0 Then                                              
  Do                                                              
   say 'AD'x||nd.cnt||'BD'x||','                                  
  End                                                             
 Else                                                             
  Do                                                              
   say 'AD'x||nd.cnt||'BD'x||");"                                 
  End                                                             
end                                                               
                                                                  

Daniel LaLiberte

unread,
Dec 7, 2015, 4:02:54 PM12/7/15
to Google Visualization API
Hi Michael,

The main problem is that your generated data is not correct, resulting in a syntax error that basically stops everything.  Notice these lines:

dataTable.addRows([

// Instantiate and draw the chart.

var formatter = new google.visualization.DateFormat({pattern: 'yyyy/MM/dd'});


There is no rows of data following the addRows() call.
So adding the "Do" loop in your server-side code is not doing what you expected.  You'll have to solve that before you can proceed with this approach.

Michael Rooney

unread,
Dec 8, 2015, 7:25:32 PM12/8/15
to Google Visualization API
Resolved. Unix file permission was not set. The older server ran as administrator and didn't care about permission bits.
Reply all
Reply to author
Forward
0 new messages