Re: Db2dclgn Indicator variables
- From: "Rick Smith" <ricksmith@xxxxxxx>
- Date: Fri, 19 Jan 2007 17:39:45 -0500
"Dan van Ginhoven" <danfan46@xxxxxxxxxxx> wrote in message
news:p8ash.29708$E02.12011@xxxxxxxxxxxxxxxxxx
Hi!
I'm using db2 UDV v9.1 and MF Cobol Net Express v 5.
db2dclgn generates cobol descriptions for a table.
Like table Employee in the sample database.
01 EMPLOYEE.
05 EMPNO PIC X(6).
05 FIRSTNME.
49 LEN PIC S9(4) COMP-5.
49 DAT PIC X(12).
05 MIDINIT PIC X(1).
05 LASTNAME.
49 LEN PIC S9(4) COMP-5.
49 DAT PIC X(15).
05 WORKDEPT PIC X(3).
05 PHONENO PIC X(4).
05 HIREDATE PIC X(10).
05 JOB PIC X(8).
05 EDLEVEL PIC S9(4) COMP-5.
05 SEX PIC X(1).
05 BIRTHDATE PIC X(10).
05 SALARY PIC S9(7)V9(2) COMP-3.
05 BONUS PIC S9(7)V9(2) COMP-3.
05 COMM PIC S9(7)V9(2) COMP-3.
01 IND-TAB-EMPLOYEE.
05 IND-EMPLOYEE PIC S9(4) COMP-5 OCCURS 14 TIMES.
1. Why doesn't IBM provide a prefix for varchar LEN and DAT fields ?
Now I have to refer to "DAT in FIRSTNME in EMP" which is bit
tedious.
Any workaround ?
(The internal table description generator in Netexpress generates
MIDINIT-DAT and MIDINIT-LEN)
First, data-names need not be qualified more than is
required to make them unique; for the example given,
LEN IN FIRSTNME
DAT IN FIRSTNME
LEN IN LASTNAME
DAT IN LASTNAME
Second, one might use the RENAMES clause, then,
in the procedure division, use the alternative name,
66 FIRSTNME-LEN RENAMES LEN IN FIRSTNME.
66 FIRSTNME-DAT RENAMES DAT IN FIRSTNME.
66 LASTNAME-LEN RENAMES LEN IN LASTNAME.
66 LASTNAME-DAT RENAMES DAT IN LASTNAME.
Whether the RENAMES clause is better or worse
than other means is a matter of some debate!
I offer it only as a possibility.
.
- References:
- Db2dclgn Indicator variables
- From: Dan van Ginhoven
- Db2dclgn Indicator variables
- Prev by Date: Re: Db2dclgn Indicator variables
- Next by Date: Re: Db2dclgn Indicator variables
- Previous by thread: Re: Db2dclgn Indicator variables
- Next by thread: Re: Db2dclgn Indicator variables
- Index(es):