 |
 |
Dynamic Forms
By Harry M Cleveland |
|
 |
At Temple University, we have a very complex FOCUS (MSO) / WebFOCUS installation with only three administrators to support over 700 mainframe FOCUS users and several hundred WebFOCUS users. Most of our historical data resides on thousands of IBM mainframe cartridge tapes. The tapes are broken down into four semesters per year, five cycles per semester (beginning of semester, drop/add, middle, end and final) and further segregated by data type (i.e., admissions, registration, course, instructor, etc.).
Using WebFOCUS, we created a number of applications allowing users to select a cycle, semester and data type. Each of these applications submits a procedure on the mainframe that mounts the desired tape and creates a temporary disk dataset. FOCUS/WebFOCUS users are then able to run reports using the disk dataset and after four business days, the dataset is automatically deleted from the system. These applications have addressed the problem of giving users access to historical data and keeping the IBM mainframe relatively free of permanent disk datasets.
Although this technique has generally worked well, it has not been without its problems. All of the html documents were static. Whenever a new semester/cycle dataset was created, we had to manually update each of the many html documents. This required our unit to be aware of the creation of any new datasets. Since we are very involved in creating new applications and managing support issues, we occasionally missed the creation of new datasets – until users called asking for the data. When this happened, we had to drop what we were doing, investigate what new datasets were generated and modify html documents. This proved to be a real pain for everyone.
We needed a way to automatically populate a list of tape datasets in our html pages. We had used the !IBI.FIL. coding concept before and knew we could populate a drop down list in an html document. However, we were stuck when it came to using WebFOCUS to determine what tape datasets were available on the mainframe.
We knew the IBM LISTCAT function worked (as long as we were in TSO), but users are not permitted TSO access at our site. We needed a technique that would allow users to query the tape catalog from within WebFOCUS.
We developed an assembler user written subroutine that returns a catalog listing of tape datasets from within FOCUS/WebFOCUS. We then TABLE the listing of tape datasets to a HOLD file. The HOLD file is used to dynamically generate the html drop down list to display the available data. The procedure then performs a –HTMLFORM to display an html form. The user selects the desired semester and cycle from the form and WebFOCUS submits another procedure that builds mainframe JCL and submits it to the batch subsystem. Once the JCL is submitted, an html page is displayed informing the user their job was submitted and instructs them how to allocate the disk dataset from within FOCUS or WebFOCUS.
So, from having a static environment that required a lot of manual interaction and inconvenience, we now have a very dynamic environment that requires no support. Data are made available to the users immediately. Users have what they need and we don’t get as many phone calls. Everyone is happy.
Although all of this sounds relatively simple and straight forward, the coding aspects were quite complex. Below are the various screens and procedures that drive the application.
Users are given a choice of datasets to extract from a WebFOCUS html page. There are separate procedures for each of the menu selections.

When the user makes a selection, a FOCUS procedure is executed on the mainframe:
<a href="/ibi_apps/WFServlet?IBIF_ex=CSTERM">Copy Student Term (STERM)
tape data to personal mainframe disk file</a>
Mainframe Procedure
Note the Temple University user written subroutine GETCAT to retrieve a list of tape datasets:
-SET &X = GETCAT(&X,'A1');
Note the DEFINEd field SEMESTER used to create the dynamic drop down list values:
SEMESTER/A50 = '<option value="' ||WHATSEM || '">' || SEMTXT ||
'</option>';
Note the inclusion of the -HTMLFORM to display the dynamic page (the html and javascript used to display the form resides on the mainframe):
-HTMLFORM CSTERM
-SET &ECHO = ALL;
-*
-* Replaces IDCAMS SYSIN
-*
DYNAM ALLOC FILE CATCTL NEW RECFM FB -
LRECL 80 BLKSIZE 3120 SPACE 1,1 TRK REUSE
-*
-* Replaces IDCAMS SYSPRINT
-*
DYNAM ALLOC FILE CATLST NEW RECFM VBA -
LRECL 125 BLKSIZE 27998 SPACE 2,1 TRK REUSE
-*
-* PRINT80 is a MFD used to read an 80 byte field named CONTENTS
-*
DYNAM ALLOC FILE PRNT80 NEW RECFM FB -
LRECL 80 BLKSIZE 3120 SPACE 1,1 TRK REUSE
-*
-RUN
-*
-* Create the tape dataset name mask (first five nodes)
-*
-SET &CAT1 = ' LISTC LVL(' || '''' ||
- 'PN0100.A143200.P87.P87800.STERM' || '''' || ') VOL';
-*
-WRITE CATCTL &CAT1
-*
-RUN
-*
-* Call the user written subroutine (i.e., GETCAT) to retrieve a list of tape datasets
-*
-SET &X = ' ';
-SET &X = GETCAT(&X,'A1');
-*
-* TABLE the catalog listing of tape datasets to a HOLD file
-*
DEFINE FILE PRNT80
DSNAME/A44 = SUBSTR (80,CONTENTS,1,44,44,'A44');
END
-*
TABLE FILE PRNT80
PRINT DSNAME
ON TABLE HOLD
END
-*
DYNAM FREE FILE CATCTL
DYNAM FREE FILE CATLST
DYNAM FREE FILE PRNT80
-*
-RUN
-*
-*-----------------------------------------------------------------------
-*
-* Create the HTML drop down list
-*
DEFINE FILE HOLD
NODE_POS/I3 = POSIT (DSNAME,44,'.SEM',4,'I3');
WHATSEM/A4 = SUBSTR (44,DSNAME,NODE_POS+4,44,4,'A4');
SEMWK/A2 = EDIT (WHATSEM,'$$99');
SEMYR/A2 = EDIT (WHATSEM,'99$$');
SEMESTERY2K/A6 = IF SEMYR LT '50' THEN ('20' | WHATSEM)
ELSE ('19' | WHATSEM);
D_SEM/A8 = DECODE SEMWK (03 'Spring'
20 'Summer 1'
26 'Summer 2'
36 'Fall'
ELSE 'ERROR');
SEMTXT/A16 = D_SEM | ' - ' | WHATSEM;
-* Create the dynamic html for the drop down list
SEMESTER/A50 = '<option value="' ||WHATSEM|| '">' ||SEMTXT|| '</option>';
END
-*
TABLE FILE HOLD
SUM SEMESTER
-* Want the most recent semester first
BY HIGHEST SEMESTERY2K NOPRINT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS HOLDSEMS
END
-*
-RUN
-*
-*-----------------------------------------------------------------------
-*
-SET &SPACE = '&' || 'nbsp;';
-*
-* Display the HTML form to allow users to select semester/cycle
-*
-HTMLFORM CSTERM
The procedure creates a WebFOCUS page with a dynamic drop down list displaying the available semesters:

HTML Form (resides on the mainframe. Yes, the mainframe!)
Note the submission of the subsequent procedure that will dynamically build the IDCAMS JCL to repro the desired tape dataset to disk:
<input type="hidden" name="IBIF_ex" value="ZISISSTR
Note the dynamic display of available tape datasets:
!IBI.FIL.HOLDSEMS;
<HTML>
<script language="JavaScript">
function newWindow(url, height, width) {
nameW='feature'
if (navigator.appVersion.indexOf('4') != -1) {
// Vars for centering the new window on Version 4 Browsers
xTop = screen.width/2 - (width/2);
yTop = screen.height/2 - (height/2);
window.open(url, nameW, 'height='+height+',width='+width+',scrollbars=1,resizable=1,menubar=0,toolbar=1,status=0,location=0,directories=0,left=' + xTop + ',top=' + yTop + '');
} else {
window.open(url, nameW, 'height='+height+',width='+width+',scrollbars=1,resizable=1,menubar=0,toolbar=1,status=0,location=0,directories=0,left=150,top=200');
}
}
</script>
<head>
<title> WebFOCUS ISISTAPE – ISIS STERM process</title>
</head>
<!-- this section puts a shaded bar at the top of the form -->
<style type="text/css">
body {background-image: url("/ibi_html/Graphics/mistyrosebar.gif"); background-repeat: repeat-x; }
</style>
<body bgcolor="#FFFFFF">
<!-- this section puts buttons in the shaded area -->
<center>
<table border=0 width=100%>
<tr><td align=center>
<img src="/ibi_html/Graphics/templet_sm.gif" align=middle alt="Temple T" border=0>
<a href="/ibi_html/temple/isis.html">
<img src="/ibi_html/Graphics/bk2list.gif" align=middle
alt="Go to listing of ISIS reports." border=0></a>
<a href="/ibi_html/temple/main.html"><img align=middle
border=0 src="/ibi_html/Graphics/backbut.gif"
alt="Go to main WebFocus menu"></a>
<!-- this button points to the help file for the report -->
<a align=center
href="javascript:newWindow('/ibi_html/isis/isistapehelp.html',400,600);">
<img align=middle border=0 src="/ibi_html/Graphics/helpbut.gif"
alt="Get help with this report."></a>
<a href="javascript:newWindow('/ibi_html/isis/contact.html',400,600);">
<img src="/ibi_html/Graphics/contstaf.gif" align=middle
alt="E-mail addresses and phone numbers of support staff." border=0></a>
</td>
</tr>
</table>
</center>
<center>
<width="85%">
<form action="/ibi_apps/WFServlet" method="GET">
<input type="hidden" name="IBIF_ex" value="ZISISSTR">
<p>
<h2><font face="Arial">ISISTAPE Dataset Creator</font></h2>
<center>
<font face="Arial">Create STERM Extract</font><p>
</center>
<p>
<table border="1" bgcolor=mistyrose>
<tr>
<td>
<table border="0">
<tr>
<td><font size="2" face="Arial"><b>Select Semester:</b></font></td>
<td><font size="2" face="Arial">
<select name="SEMESTER" size="1">
!IBI.FIL.HOLDSEMS;
</select></font></td>
</tr>
<tr>
<td><font size="2" face="Arial"><b>Select Cycle:</b></font></td>
<td><font size="2" face="Arial">
<select name="CYCLE" size="1">
<option selected value="BEG">Beginning (first day of class)</option>
<option value="DRAD">After Drop/Add (after 2nd week)</option>
<option value="MID">Mid (after 6th week)</option>
<option value="END">End (after 12th week - used for official reporting)</option>
<option value="FNL">Final (used for government reporting)</option>
</select></font></td>
</tr>
</table>
</td>
</tr>
</table>
<p>
<font face="Arial">
<input type="submit" name="Submit" value="Submit">
<input type=reset name="Reset" value="Reset Values">
<input type="hidden" name="IBIC_server" value="EDAUSER">
<input type="hidden" name="TUHTML" value="ISISSTRM">
<input type="hidden" name="&TUEXEC" value="ZISISSTR">
</font>
</p>
</form>
<center>
<table border=0 width=100%>
<tr><td align=center>
<font size=-1>
<a href="/ibi_html/temple/isis.html">Back to report list</a>
!IBI.AMP.SPACE; !IBI.AMP.SPACE;
<a href="/ibi_html/temple/main.html">
Back to main menu</a>
!IBI.AMP.SPACE; !IBI.AMP.SPACE;
<a href="javascript:newWindow('/ibi_html/isis/contact.html',400,600);">
Contact Support Staff</a>
</font>
</td>
</tr>
</table>
</center>
</center>
</HTML>
Mainframe code submitted by –HTMLFORM
-*---------------------------------------------------------------------------------------------------------
-* RPC NAME: ZISISSTR - STERM EXTRACTION
-* AUTHORS: PAUL F. SMITH/HARRY M CLEVELAND
-* THOMAS FINNEY – Assembler user written subroutines
-* PURPOSE: ALLOWS USERS TO SUBMIT ISISTAPE JOBS VIA
-* WEBFOCUS/JCL.
-*
-* VARIABLES PASSED VIA WEB PAGE: &SEMESTER AND &YEAR.
-*
-*---------------------------------------------------------------------------------------------------------
-*
-SET &ECHO = ALL;
-*
-TYPE THIS IS REPORT MSO.U772400.P02.EDARPC(ZISISSTR)
-*
-* ********************************************************************
-* GET THE USER ID.
-* ********************************************************************
-*
-* A Temple user written subroutine to retrieve the ‘true’ RACF user id
-*
-SET &WHO_AM_I = GETRACF('A8');
-*
-* ********************************************************************
-* RESOLVE THE PARAMETERS PASSED BY HTML.
-* ********************************************************************
-*
-SET &DISKFILE = 'UN0100.' || &WHO_AM_I || '.' || &CYCLE || &SEMESTER
- || '.STERM' ;
-*
-SET &TAPEFILE = 'PN0100.A143200.P87.P87800.STERM.' || &CYCLE || '.SEM'
- || &SEMESTER ;
-*
-*----------------------------------------------------------------------------------------------------------*
-* *********************************************************************
-* GET THE TIME OF DAY.
-* *********************************************************************
-*
-SET &NOW_TIME = HHMMSS ('A8');
-*
-* *********************************************************************
-* CREATE THE THIRD NODE OF THE JCL DATASET NAME.
-* *********************************************************************
-*
-SET &ENODE = 'E' || EDIT (&NOW_TIME,'99$99$99');
-*
-***********************************************************************
-* CREATE A DUMMY DATASET NAME TO CONTAIN THE JCL.
-***********************************************************************
-*
-SET &DATASET = '''' || 'UN0100.' || &WHO_AM_I || '.' || &ENODE || '''';
-*
-* *********************************************************************
-* CHECK TO SEE IF DATASET ALREADY EXISTS.
-* *********************************************************************
-*
-RUN
-? TSO DSNAME &DATASET
-IF &RETCODE NE 0 THEN GOTO ALLOCNEW;
-*
-* *********************************************************************
-* IF THE JCLOUT ALREADY EXISTS, DELETE IT.
-* *********************************************************************
-*
DYNAM DELETE &DATASET
-*
-RUN
-*
-* *********************************************************************
-* CREATE THE JCLOUT DATASET.
-* *********************************************************************
-*
-ALLOCNEW
-*
DYNAM ALLOC FILE JCLOUT DA &DATASET -
NEW CATLG UNIT SYSDA SPACE 1,1 TRACKS -
LRECL 80 RECFM FB BLKSIZE 6080 REUSE
-*
-RUN
-*
-* *********************************************************************
-* CREATE THE NOTIFY PARAMETER FOR THE JOB CARD.
-* *********************************************************************
-*
-SET &NOTIFY = 'NOTIFY=' || &WHO_AM_I || ',';
-*
-SET &COMMA = ',';
-*
-* *********************************************************************
-* CREATE THE JCL.
-* *********************************************************************
-*
-WRITE JCLOUT //&WHO_AM_I JOB (EDA),WEBFOCUS ',&NOTIFY
-WRITE JCLOUT // MSGCLASS=T,CLASS=A,MSGLEVEL=(1,1)
-WRITE JCLOUT //REPRO EXEC PGM=IDCAMS
-WRITE JCLOUT //SYSPRINT DD SYSOUT=*
-WRITE JCLOUT //I DD DISP=SHR,DSN=&TAPEFILE
-WRITE JCLOUT //O DD DSN=&DISKFILE&COMMA
-WRITE JCLOUT // DISP=(NEW,CATLG),UNIT=SYSDA&COMMA
-WRITE JCLOUT // SPACE=(TRK,(2000,200),RLSE)&COMMA
-WRITE JCLOUT // DCB=(LRECL=2500,RECFM=FB,BLKSIZE=27500)
-WRITE JCLOUT //SYSIN DD *
-WRITE JCLOUT REPRO IFILE(I) OFILE(O)
-WRITE JCLOUT /*
-*
-RUN
-*
-* *********************************************************************
-* FREE THE JCL FILE.
-* *********************************************************************
-*
DYNAM FREE FILE JCLOUT
-*
-* *********************************************************************
-* SUBMIT THE JCL.
-* *********************************************************************
-*
DYNAM SUBMIT &DATASET
-*
-RUN
-*
-* *********************************************************************
-* DELETE THE JCL.
-* *********************************************************************
-*
DYNAM DELETE &DATASET
-*
-RUN
-*
-* *********************************************************************
-* NOTIFY USER THEIR JOB WAS SUBMITTED.
-* *********************************************************************
-*
-* A WebFOCUS report is generated to tell the user a batch job was submitted to
-* create the temporary disk dataset.
-*
DEFINE FILE PRNT80
HREF/A120 WITH CONTENTS =
'<a HREF="https://webfocus.admin.temple.edu/ibi_html/temple/listcat.html">'
|| 'Click here for LISTCAT Utility';
END
-*
DYNAM ALLOC FILE PRNT80 DA -
MSO.A143200.LIB0000.FOCEXEC(DUMMY) SHR REUSE
-*
TABLE FILE PRNT80
PRINT CONTENTS NOPRINT
HEADING
" "
ON TABLE SET PAGE OFF
ON TABLE SUBHEAD
" "
"Your batch job has been submitted."
" "
"The job output will be directed to:"
" "
"&DISKFILE"
" "
"Use the following allocation for your personal dataset:"
" "
"DYNAM ALLOC FILE ALTTERM2 DA &DISKFILE SHR REUSE"
" "
"It will take some time to process the request"
"for data. Use the LISTCAT program under the"
"Other Utilities button to determine if your"
"dataset is available."
" "
"<HREF>"
ON TABLE SUBFOOT
"Click mouse on button to return to WebFOCUS Main page ..."
ON TABLE SET STYLE *
TYPE=REPORT, SIZE=9, SQUEEZE=ON, GRID=OFF,$
TYPE=HEADING, COLOR=RGB(153 051 051), BACKCOLOR=WHITE, STYLE=BOLD,
JUSTIFY=CENTER, HEADALIGN=INTERNAL,$
TYPE=SUBFOOT, SIZE=9, COLOR=BLACK, BACKCOLOR=WHITE, STYLE=BOLD,$
TYPE=TABHEADING, SIZE=11, COLOR=RGB(153 051 051), STYLE=BOLD,
BACKCOLOR=WHITE, JUSTIFY=CENTER,$
TYPE=TABHEADING, IMAGEBREAK=ON,
IMAGE=https://webfocus.admin.temple.edu/ibi_html/Graphics/TUbanner.gif,$
TYPE=TABFOOTING, JUSTIFY=CENTER, SIZE=9, STYLE=ITALIC, FONT=ARIAL,$
TYPE=TABFOOTING, IMAGEALIGN=RIGHT, IMAGEBREAK=OFF,
IMAGE=https://webfocus.admin.temple.edu/ibi_html/graphics/backto.gif,
URL=https://webfocus.admin.temple.edu/ibi_html/temple/main.html,$
END
-*
-RUN
A WebFOCUS report is generated to inform users a batch job was submitted, the name of the dataset to be created and the DYNAM command to allocate the dataset. Users can cut and paste the DYNAM command into their FOCUS/WebFOCUS procedure. Because the LISTCAT JCL runs in batch, users have no way of knowing when the batch job finishes (users do not have TSO access). So, they are given the ability to determine what ‘personal’ disk datasets are available by clicking on the LISTCAT link on the bottom of the page. This link initiates another series of html pages and procedures created to shield users from the complexities of using the IBM mainframe environment.

If any questions, please contact Harry at harry.cleveland@temple.edu. |