Updates to asgnt3 (sis report generating program) rjl 030923 rjlref: 03f522asgnt3Update030923. doc Assignment 3: Write sis application stub using genv12 code library



Download 12.49 Kb.
Date28.01.2017
Size12.49 Kb.
#9289
Updates to asgnt3 (SIS report generating program) - RJL 030923 RJLRef: 03f522asgnt3Update030923.doc

Assignment 3: Write SIS application stub using genv12 code library.

The purpose of this implementation exercise is to appreciate the relative complexity of analysis vs. design vs. re-use by using genv12 to convert your SIS.sch file into an API (Application Programmer Interface) code library, and using it and COOL's standardized data structures, naming conventions and table navigation methods to implement two report generators. [Asgnt2 vs. 2.3.6: CS=SE, TM=TE, CD=CO]



(1) Use chgen (v12) to generate ORDB code and metadata from your schema definition. Deliverables: Code directory file stats and schema content (tables TT and TA).

(2) Write a report generator in C or C++ and compile it linked to the pr_util library API from chgen. Deliverables: source code and compilation typescript with warnings from stderr (log of build and test procedures) e.g. via this command ('&' merges stderr with stdout in typescript).

'script; col -bx < typescript > logfile'

(3) Your program should import (pr_load) your test database and produce 2 reports.



[Hint: Use table_loop and child_loop macros (for-loops) to navigate the memory-resident tables in two ways: CS--->EN>---ST to produce rosters.dat (a student roster for each section), and ST---->EN>---CS to produce grades.dat (a grade report for each student).] (Do not insert a page-break to separate each roster or grade report page - it only wastes paper.)

Notes for Asgnt 3: [docs refs changed from ver_12 to ver_11log.]

3.1 Read the chgen User Manual (latest is for ver_10log at

../COOL-GEN/chgen_docs/gencxv10log_manual.pdf.

The successor of genv10log is $CASE/99s523/genmerge/ = $CASE/gen/ver_11_link . Its User Guide update (Section 5), is appended to this memo. The User Manual at $CASE/genv10log is in .tex/.dvi/.ps format and was never converted to MSWord.


Note particularly the schema format and the (over-simplified) school database example. Use genv12 to run this exercise; genv12 is upward-compatible from genv8, and extends the -log option to support bde replay.
[A possible asgnt4 will involve setting the proper logging options during code generation. Then, calling startlog will log your SIS database changes, and pr_load will recognize the logfile and play it back in a subsequent run. For log and replay updates, see $CASE/gen/ver_12/doc/chgenv12.doc.]

3.2 Log into cs = saturn via a vt100 (SSH) or xterm (UNIX) window and type these two commands or add them to your .login file: (setenv is for recommended shell csh or tcsh; use set and export commands in sh):

setenv CASE '/usr/proj3/case';

alias gen ' $CASE/gen/ver_12/chgen'
3.3 Using the environment variable $CASE, the command alias 'gen' invokes genv12 for your current platform ($HOSTTYPE) from your current working directory. To run genv12, type

gen -metafile -log -ansi SIS.sch

[Note: chgen is not yet compiled for Linux platforms - RJL 030923]
3.4 Running genv12 on a correctly formatted SIS.sch' will generate tables TT and TA in metaschema.dat and an ANSI-C code library of files named pr_*.c.
3.5 Please note: ... (see online assignments 2and 3)

=====================================

5.0 User's Manual (A copy of Section 5, p. 119 of

/gen/ver_11_project.doc)

Postscript , LaTex, and .dvi versions of the chgenv10 User Manual (Reference 7) are available in /usr/proj3/case/gen/ver_10/doc. Unfortunately, this was never converted to Word format, therefore we do not have a later complete user Manual. However, instructions for the new command line options are contained in the following release notes for chgenv11, and genv12 updates are reported in ..\COOL-GEN\chgen_docs\chgenv12r1.doc

(from sjaganat in $CASE/gen/ver_12/doc/).

5.1 New Command Line Input Options ($CASE/gen/ver_11log)


-datinput This option specifies that the metaschema data is to be read from a .dat input file, where is the base name of the run; for example house, schooldb, jpbatch, etc. Since this option uses the pr_load() function, it also requires a .viewdefs file to exist in the same directory as the .dat file. A sample .viewdefs file is shown in Figure 4.0.2
-viewname This option is required if -datinput is specified. It is used to specify the name of the view to be used for the run. The .viewdefs file in Figure 4.0.2 contains only one view, so in this example the correct command line option is -viewname LatestView. Note that -viewname must be followed by the view name. If no further command line options are entered, then chgenv11 will print an error message and abort. If another option such as -ansi is entered immediately after -viewname (with no view name immediately following), then -ansi will be used for the view name, with unpredictable results.
Therefore, a typical execution of chgenv11 with the -datinput option might look like:

$CHGENV11 jpbatch -ansi -datinput -metafile -viewname LatestView


5.2 Limitations on -datinput Feature


  • The -datinput option is limited to the use of 8 digit key sizes.

  • The -datinput option is compatible with the -gendbschema option.

5.3 Sample Input Files


Sample .sch, .viewdefs, and .dat input files are presented in Section 4.

Download 12.49 Kb.

Share with your friends:




The database is protected by copyright ©ininet.org 2024
send message

    Main page