Customer Friendly Self-Service



Customer Friendly Self-Service

By Harry M Cleveland

At Temple University, FOCUS and WebFOCUS users are able to access all of the data stored on the University's IBM mainframe - Student, HR, Payroll and Financial. For many years, our mainframe has been the sole repository of all of our historical data. However, as is the case with many other enterprises, we have felt the pressure to move more and more applications and data off of the mainframe and on to our WebFOCUS server.

Over the last year, we have downloaded decades of historical data to our WebFOCUS server and have allowed users to access these data in a WebFOCUS self service environment. There are literally thousands of historical datasets spread over dozens of directories on our server. Most are in the form of flat files, some in FOCUS databases and others in relational file structures.

Since we only offer users a self service reporting environment (that is, no MRE or Developer Studio), the allocation and use of these datasets on the WebFOCUS server has proven problematic – mainly due to users not knowing the names or the location of the datasets on the server. We needed to create a tool that would give users the ability to automatically allocate a specific dataset. More importantly, we needed to develop a simple query tool that would allow casual users the ability to easily display and select the fields they want to appear in a report, allow sorting and record selection tests and offer some additional formatting functionality. Granted, MRE and Developer Studio would have addressed most of our needs, however, they were not a viable option for us.

For Student data, we present the following static web page:


(image#1)

The drop down list allows users to select the type of data desired – Registration, Admission, Revenue, etc. For a given type of data, there can be hundreds of individual datasets.

(image#2)

In WebFOCUS, the user's selection is stored in an amper variable named &SOURCE. When a user selects the data source and clicks the Submit button, a FOCEXEC is executed using the value of &SOURCE to dynamically create a web page using inline HTML (-HTMLFORM BEGIN) . If a user selects STERM, the names of all of the available STERM datasets are used to populate a drop down list and all of the field names within the STERM dataset are also presented.

Here is an example of the dynamically generated inline HTML page WebFOCUS created for Student Registration data (i.e., STERM):


(image#3)

The first prompt, Select Semester, contains the dynamically generated list of all STERM datasets on the WebFOCUS server. To allocate a dataset, a user selects the desired dataset from the drop down list.


(image#4)

The list is generated using the old DOS DIR command piped to a temporary dataset:

-DOS  DIR D:\IBI\ISIS\STERM\*.txt > dirlist.txt

The FOCEXEC TABLE FILEs the dirlist.txt file and stores all of the dataset names in a HOLD file. The resulting values are later displayed using inline HTML and the !IBI.FIL.hold-file-name; technique.

Whenever a new dataset is created on the server, the name of the dataset automatically appears in the drop down list. Using WebFOCUS to dynamically populate and create web pages eliminates the thought and effort that goes into maintaining static web pages.

At Temple, we have hundreds of web pages in our WebFOCUS self service environment. It is impossible to remember what pages have to be changed periodically. Using dynamic inline HTLM to automatically generate our web pages has saved us many hours of labor each year.

The next prompt, Select Field Name(s), allows the user to select the type of report to be created by clicking on the PRINT, SUM or LIST radio buttons. Granted, the reporting capabilities are fairly basic; however, our goal was to shield hundreds of casual WebFOCUS users from the complexity of knowing the names and locations of thousands of datasets, tens of thousands of field names and to provide them a simple query tool.


(image#5)

A drop down lists all of the fields (sorted alphabetically) within the dataset and is dynamically created at run time. The CHECK FILE filename HOLD technique is used to capture the field names from the Master File Description.

CHECK FILE STERM HOLD
-*
DEFINE FILE HOLD
 FIELDNAME/A40 = EDIT (FIELDNAME,'9999999999999999999999999999999999999999');
 HTMLNAME/A150 = '<OPTION VALUE="' || FIELDNAME || '">' || FIELDNAME
                    || '</OPTION>';
END
-*
TABLE FILE HOLD
 BY HTMLNAME
 IF FIELDNAME NE 'FILLER$*' OR ' ' OR 'F2500' OR 'SOC_SEC_NO'
 ON TABLE SET HOLDLIST PRINTONLY
 ON TABLE HOLD AS HOLDLIST FORMAT ALPHA
END

The list of sorted fieldnames are incorporated into the web page using !IBI.FIL.HOLDLIST; from within the FOCEXEC's inline HTML.

Because the code is dynamically created, when a user selects a different data source, the list of field names generated are unique to that data source.

Users may select one or more fields to display by double clicking on the field name. The resulting field selection is displayed in the companion drop down list. To deselect a field, a user double clicks on the field name in the companion box. The placement of the field within the final report can also be modified using the Up and Down buttons. For example, a user can select to have GRADE_PTS moved up above GPA.

All of this functionality is achieved by combining the power and flexibility of WebFOCUS with a lot of very complex JavaScript. Fortunately, some of the JavaScript code was available on the web and some was given to me by very kind and sympathetic developers who got tired of hearing me cry and beg for help. Much of the code, however, required a tremendous amount of trial and error and a frequent head banging.

Three levels of sorting are available. The first drop down list contains a listing of every field within the data source. The remaining three drop down lists are used for formatting.


(image#6)

For example, the following drop down list demonstrates the sort break formatting options available to users:


(image#7)

Three record selection tests are available:


(image#8)

Users can construct WHERE tests to suit their reporting needs. Note the question mark enclosed in a red box. When a user clicks on the box, a help page appears presenting information on how to construct a valid record selection test and provides numerous examples. A number of these boxes appear on the web page. Each of them offers context sensitive help.

Some additional functionality includes turning off page breaks, limiting record retrieval to 100 records, sending report output to the browser, Excel or several other formats and viewing the source code.


(image#9)

The View the Source Code option expands the capability of the tool by bringing the WebFOCUS code up in an ‘ad hoc' window that allows users to view the code and, for those more familiar with WebFOCUS syntax, provides the experienced user the ability to modify the code. Based upon the selections made on the web page, the following web page is dynamically generated:


(image#10)

Users can view and submit the report code or make modifications to the code in the ad hoc box. Some users actually save the code in a document so they can run the report again at a later date. They do so by copying and pasting the code into one of our ad hoc web pages. The ability to view the code also serves as a learning tool. Users are able to become familiar with the WebFOCUS syntax.

If you take note of the first line in the code above, you will understand why we created a tool to help allocate datasets. Not many of our users (myself included) can remember the names or location of our datasets.

The WebFOCUS code to create this application is quite lengthy (more than 30 pages) and complex. It's an irony that the more simple one tries to make an application for users, the more complex the application often becomes. The code incorporates dozens of advanced tricks and techniques including inline HTML to dynamically create web pages coupled with very complex JavaScript. There are no static web pages for the support staff to maintain. Whenever a new dataset becomes available, it is automatically incorporated into the application. However, the real benefit of the application is that even the most casual user can easily allocate datasets and produce reports on their own without having to call the WebFOCUS support staff.

WebFOCUS provides developers an extraordinarily rich environment to create highly productive applications as well as empowering users with the ability to easily create reports to satisfy their need for data.

Attached here is the complete code for your reference.

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