| |
Tips and Tools :
Personalizers :
Reportbuilder :
Reading non-IOSYS Files |
Reading non-IOSYS Files in Walker Reportbuilder
Walker's Reportbuilder includes a handy, but little-known feature that allows you
to use a non-IOSYS file as the primary database for your report. This
article tells how.
Why read non-IOSYS Files?
It is fairly easy to use a dataset that does not reside in your
database as the "primary database" for a Walker report. There are several
reasons why you might want to do this:
|
to write a quick report on a non-Walker dataset.
|
|
to combine data from a non-Walker dataset and data from the Walker
databases in one report.
|
|
to combine data from different Walker regions in one report.
|
How do you do it?
| Choose one of the formats supported by the Reportbuilder Non-IOSYS File I/O
program, MRG307S.
File Type |
Max data bytes |
Dataset RECFM |
Dataset LRECL |
DDNAME |
TAPEF080 |
80 |
FB |
80 |
TAPF080 |
TAPEV200 |
200 |
VB |
204 |
TAPV200 |
DISKV452 |
452 |
VB |
456 |
DSKV452 |
(There are 5 additional file types, RGAREB0 through RGAREB4, which are
reserved for use with Responsibility Reporting.)
(Alternatively, you could enhance the Walker
MRG307S program and TGS FID to include your own formats.)
|
|
Choose a logical filename for your input file.
Set up an FID entry for this logical filename. Use the File Type
from the table above for the format you have chosen. Use a key
displacement and key length of zero, since these are non-keyed files.
|
|
Set up DDM entries for your logical filename. Note that bytes 1-2 will
always contain the binary record length, just as with any other Walker file.
(This is even true when reading file type TAPEF080.) Your first data byte will
follow the record length, in record displacement 3.
|
|
Use your logical filename on the REPORT statement, and use the field names
from the DDM as with any other file.
|
| If necessary, convert your input dataset to your chosen format. Here is some sample JCL for converting a
fixed dataset into the DISKV452 format:
//* -------------------------------------------------------------------
//* REFORMAT THE FILE TO VARIABLE 452 FOR INPUT TO WALKER REPORTBUILDER
//* -------------------------------------------------------------------
//REFORMAT EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSUT1 DD DSN=xxx,DISP=SHR
//SYSUT2 DD DSN=xxx.V452,
//
DISP=(NEW,CATLG,DELETE),
//
DCB=(RECFM=VB,LRECL=456),
//
UNIT=SYSDA,
//
SPACE=(CYL,(10,10),RLSE)
//SYSPRINT DD SYSOUT=*
|
|
Add a DD statement to the JCL that runs your report. Use the DDNAME from
the table above. Here's an example
for DISKV452:
//WBRG100.DSKV452 DD DSN=xxx,DISP=SHR
|
Notes:
|
The file type names are slightly different from the DD names. Be
careful.
|
|
The Walker names include a number that refers to the maximum number of
data bytes. With variable length records, the Operating System reserves
an additional 4 bytes at the beginning of each record for the record length;
the LRECL is 4 bytes longer than the maximum number of actual data bytes.
Therefore, for variable formats, the LRECL must be 4 bytes more than the number
specified in the Walker format name.
|
|
The Operating System's 4-byte zoned record length is not returned to the
report. The Reportbuilder always returns the maximum record length in
the RECORD-LENGTH field, even when records in the input file are shorter
than the maximum. You should understand the nature of your input data
and be careful not to use data past the end of the record.
|
|
You will receive an error message if you try to use a file with an
incorrect RECFM or LRECL.
|
|
The input files can come from any source (disk, tape, etc.) regardless of
the format name.
|
|
The input records do not have to be sorted in any specific order.
|
|
You cannot use non-IOSYS files in generic or direct reads. They are
only be used with Reportbuilder as the primary
database.
|
Contributed by
JC Cunningham
| |
|