|
Customer Support: What's Happening in the World of FOCUS
One of the advantages of being in Customer Support is
speaking with many of our customers who are creating lots of interesting
applications. And that also means we can see generic problems or
misunderstandings that people encounter.
With that in mind, we are launching this Customer
Support column as a forum to let you know about issues that are important
to the entire FOCUS community, as well as alerts, techniques, and new features.
In this column, we address the issue of
the new
MASTER parser. With release 7.2 of FOCUS for S/390, a new master parser
became the norm. In release 7.1.1, you could
SET MASTER=NEW, and we did
recommend it in a few cases with VSAM groups, but it was not the default.
Now, in release 7.2, it is the default. As with other
NEW settings,
programmers read the documentation and assume everyone is following the rules, and so
they can now enforce them. There is an entire "grammar" associated with the Master
that says
ACCESS goes with
FILE, DESC goes with
FIELD, etc. Unfortunately, although
we all knew the rules, we didn't always follow them, and so we would put
DESC before
even the
FILE declaration, and it was treated as a comment.
Other strange and wonderful variations crept into our code, and
the
MASTER=OLD kept on working. However, it was necessary to change it to
support all the new things in masters, and so
MASTER=NEW, which objects to our more "creative" variations.
Take a look at the following examples, and if in fact you have masters
that are colorful, you might want to fix them before going to release 7.2 or higher. You can't
stay
OLD for very long.
Using Master=New
A
DEFINE field in a Master File Description (MFD) had a
TITLE associated with it and
needed a ,
$ after the
TITLE keyword and text associated with it. The correct syntax is
DEFINE ... ; TITLE=...,$
The problem here was that the error message indicated it did not
recognize the first
DEFINE reference in the
TABLE request, which was not the same DEFINE
in question (listed afterwards, at the end of the MFD). This is code tightening associated with
SET MASTER=NEW.
With the following MFD as an example:
FILE=ACADAPTX,SUFFIX=FIX
SEGNAME=ONE,SEGTYPE=
FIELD=SSN ,ALIAS= ,USAGE=A9 ,ACTUAL=A9 ,$
<etc.> |
The result was the following message:
TABLE FILE ACADAPTX
ERROR AT OR NEAR LINE 3 IN PROCEDURE ACADAPTX
(FOC1822) WARNING. INVALID SYMBOL: >ALIAS<
-------------------------vvvvv
FIELD=SSN ,ALIAS= ,USAGE=A9 ,ACTUAL=A9 ,$
<etc.> |
It works fine if you have the
SEGMENT DECLARATION coded as follows:
SEGNAME=ONE,SEGTYPE= ,$
The
NEW MASTER parser is requesting that an explicit
SEGTYPE be supplied.
If you had used S0, the ending, ,
$, might not have been necessary. This also is code tightening
associated with
SET MASTER=NEW.
A
FOC1822 may be generated when there is no
SEGMENT declaration at all in
the
MASTER. A
SEGMENT declaration is now required.
A
FOC1822 may also be generated when there is no dollar sign ($) coded at
the end of a
DEFINE field in the MFD, after the appropriate semi-colon. Since a MFD is a
comma-delimited file, the dollar sign ($) is required. If there is no TITLE, as in our
first example, the dollar sign ($) should be coded directly after the semi-colon (;)
for the
DEFINE field in question.
A
FOC1822 may also appear when the first non-comment line in a MFD is not
FILE=.
Examples:
DEFINE TEMPFLD/A5 = 'X';,$
FILE=CAR,SUFFIX=FOC |
DESC=THIS IS THE CAR FILE AND THIS SHOULD BE A COMMENT,$
FILE=CAR,SUFFIX=FOC |
(5) A
FOC336 message may occur (
CHECK FILE or
TABLE request) using SET MASTER=NEW.
(FOC336) THE SUM OF ALL FIELD LENGTHS EXCEEDS MAXIMUM.
The sum of the lengths of all fields in a structure exceeds the limit.
The default limit is 32,768 bytes. Reduce the number and size of the fields in the file,
or eliminate
JOINs and cross-references if possible.
This is actually a correction in behavior. The
SUM OF ALL FIELDS includes
all of the
USAGEs described in the MFD as well as any associated
DEFINEs. They must be able
to fit within
LINREC/DATREC. Default size for
LINREC/DATREC was 16 kilobytes but in FOCUS
7.2, it has been increased to the maximum of 32 kilobytes.
TABLEing or issuing a CHECK FILE against a MASTER that contains an invalid
FIELDNAME, such as a FIELDNAME with special characters like "(", may result in a U591
ABEND RC=00000001 in module FXCMEM. For example:
FIELD=(FIELD ,ALIAS=PERS_HOLIDAY_DATE ,YYMD ,DATE ,
TITLE='PERS,HOLIDAY,DATE' ,$ |
In the core FOCUS and interface manuals, we say, "
FIELDNAME is a name
that can consist of letters, digits, and underscore characters. Special characters and
embedded blanks are not advised." In our example the "(" are special characters.
If the
FIELDNAME is changed from "(" to
"T", CHECK FILE... will work.
Using the above example, the changed
FIELD declaration would look like the following:
FIELD=TFIELD ,ALIAS=PERS_HOLIDAY_DATE ,YYMD ,DATE ,
TITLE='PERS,HOLIDAY,DATE' ,$ |
JOINing a
FIX file to a
VSAM file using
RECTYPE in the
VSAM file results
in
BLANKs and 0s for any of the
VSAM file
(XREF) FIELDs.
In the VSAM MFD, the RECTYPE field is described as follows:
FIELD=RECTYPE , ,USAGE=A1 ,ACTUAL=A1 ,$ |
In the past, FOCUS would assume that the
RECTYPE value is blank.
(No value supplied in the
ALIAS value is directly after the
FIELD keyword.)
However, the
NEW MASTER parser is not making this assumption and thus
the
RECTYPE value is not found in the data file and results in
BLANKs
/0s displayed for
FIELDs from this file due to the
JOIN ... TO syntax. (Parent with unique child is
the data displayed (
BLANKs or
0s) even if the
XREF file instance does not exist.)
Adjusting the
RECTYPE FIELD declaration to the following corrected
this problem and allowed it to execute properly with
SET MASTER=NEW:
FIELD=RECTYPE ,ALIAS=XREC ,USAGE=A1 ,ACTUAL=A1 ,
ACCEPT = A OR M OR V OR ' ' ,$ |
The new
MASTER parser will not read hexadecimal internal values for
RECTYPE within
a MFD. The MFD must be strictly character-based. To clarify:
A file consists of multiple records, all but one of which have alphanumeric one-character Record
Types in byte 1 of the record. The remaining record type has a packed field beginning in the
first byte of the record.
Describing the field as
A1 and using
ACCEPT = A, ACCEPT = B, and then
ACCEPT = 'bin1' TO 'bin2' WHERE bin1 is hex(00), and bin2 is hex(99) causes problems
with TED, which cannot read unprintable characters, (which has always been the case)
and the new MASTER parser.
Describe the
RECTYPE with a
USAGE and
ACTUAL of
I1 (rather than
A1).
Then the
ACCEPT clause specifies the
DECIMAL value of the possible
RECTYPE. So,
assuming
RECTYPEs of A, B, S and again hex(00) through hex(99):
FIELD=RECTYPE,A,I1,I1,ACCEPT=193,$
FIELD=RECTYPE,B,I1,I1,ACCEPT=194,$
FIELD=RECTYPE,S,I1,I1,ACCEPT=226,$
FIELD=RECTYPE,BIN,A1,A1,ACCEPT=00 TO 153 ,$ |
These hex values are EBCDIC and can be retrieved from the character
chart in the FOCUS for S/390 manual.
|