Re: Db2dclgn Indicator variables



top post.

Aren't level-49s there for lengths of varchars?

Regards

Michael

Frank Swarbrick wrote:

For instance, I'd love to see a COBOL that supports the ANY LENGTH PREFIXED
clause for a much more natural VARCHAR. Just think of it:

01 EMPLOYEE.
05 EMPNO PIC X(6).
05 FIRSTNME PIC X ANY LENGTH
LIMIT IS 12 PREFIXED BY BINARY-SHORT.
05 MIDINIT PIC X(1).
05 LASTNAME PIC X ANY LENGTH
LIMIT IS 15
PREFIXED BY BINARY-SHORT.
05 WORKDEPT PIC X(3).

EXEC SQL
FETCH EMPNO, FIRSTNME, MIDINIT, LASTNAME, WORKDEPT
FROM EMPLOYEE
INTO :EMPNO, :FIRSTNME, :MIDINIT, :LASTNAME, :WORKDEPT
END-EXEC

MOVE 'NEWNAME' INTO LASTNAME
EXEC SQL
UPDATE EMPLOYEE
SET LASTNAME = :LASTNAME
WHERE CURRENT OF CURSOR
END-EXEC
No fiddling around with INSPECT ... in order to get the length of the field
(sans trailing spaces), no need for the SQL RTRIM function, or any other
annoying workarounds.

Of course this almost seems a pipe dream. Even if, say, Micro Focus
implemented this feature, we'd still have to have IBM implement support for
it into the precompiler. (Or does MF use it's own pre-compiler?)

I'd also love to see some kind of COBOL support for "null" values. Even
with the proposed COBOL 2008 features (of which ANY LENGTH PREFIXED is one)
I don't think there's anyway way to specify a field (other than an actual
pointer, of course), as having a value of "NULL". But I'd love to see it! I know that C# has support for this. Never seen any other language with it,
though.

Back to the real world, though...
As someone else said, you can just use DAT OF LASTNAME (or DAT IN LASTNAME)
to uniquely qualify that field. (Again, I personally would love to use
LASTNAME.DAT).

Also, there is of course nothing that says you can't edit the output from
db2dclgn prior to using it. I personally would do that unless perhaps I had
several hundred columns and no time to fiddle around editing them. You only
have to do it once. As you add new fields you just put them into the
copybook by hand, maybe using db2dclgn to guide you to the proper PICTURE
and USAGE.

Hope this helps, and is accurate. As I said, I could be wrong about the IND
thing, but I believe I am correct.

Frank


--- Frank Swarbrick
Senior Developer/Analyst - Mainframe Applications
FirstBank Data Corporation - Lakewood, CO USA
.



Relevant Pages

  • x3 Technical Support Consultants
    ... On behalf of our client who is the worldwide leader of employee ... Internet management solutions we are recruiting for 3 Technical ... Support Consultant's to work in their Chertsey offices in Surrey. ... LDAP Directory Servers ...
    (uk.jobs.offered)
  • RE: Problem when using DateDiff and slicing
    ... Apparently the iteration should happen on Employee level, ... do not create a new cube or a new measure group. ... Microsoft Online Community Support ... or a Microsoft Support Engineer within 1 business day is acceptable. ...
    (microsoft.public.sqlserver.olap)
  • Re: Flash Designers
    ... Also, when I bump into something weird, I try to write about it. ... employee to UseNet, you can't help but think that you could be hired ... the case with community-driven software and personal Web sites. ... excellent support (I have experience with some of those, a phone call, ...
    (alt.internet.search-engines)
  • Re: OpenVMS Support Issues
    ... here we have an HP employee sincerely wanting to help fix the internal problems and asking the VMS community for some ammunition to help her move some mountains. ... Consider that C.O.V. is often seen as "complain.OS.VMS" by certain key management people. ... But, when an HP employee offers to take your problems with HP support to management, I don't think it's too much to ask for a customer to provide some documentation on the problem. ...
    (comp.os.vms)
  • Re: Request for aid
    ... > guy from the internet who whines that "your employee called me an Arab ... Such a complaint would be (and in all likelihood probably already has ... letter of support in my capacity of moderator and I am sure the other ...
    (soc.culture.jewish.moderated)