× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



"COBOL400-L" <cobol400-l-bounces@xxxxxxxxxxxx> wrote on 10/26/2016
05:25:00 PM:
----- Message from "Stone, Joel" <Joel.Stone@xxxxxxxxxx> on Wed, 26
Oct 2016 17:20:11 +0000 -----

To:

"'COBOL Programming on the IBM i (AS/400 and iSeries)'" <cobol400-
l@xxxxxxxxxxxx>

Subject:

Re: [COBOL400-L] PF / LF files

Copybooks should be avoided for file layouts. Does DDS exist for
the file? Did you add the new field to the DDS source code?

For old legacy apps, copybooks were created instead of DDS specs.

But I think that you need DDS to create an LF. Or you can do it
with SQL also.

Look at the LF or PF with DSPFD filename.

You will know that an LF was set up properly when the desired key
shows up in DSPFD under the "Access Path Description" area and your
new key field appears as "Key field ..................CustID" where
CustID is your new key field.

If you have DBU that is easier - the new field should be identified
as a key field. Press F4 to see K01, K02, K03... etc on each field.

When you compile the pgm, it will automatically bring in the new key
field.


To find out how the file[*] was created to start with use the command:

DSPOBJD OBJ(*LIBL|{libraryname]{filename}) OBJTYPE(*FILE)

You want to look at the service attributes. Under there it should show you
the source information for the file. If the information is blank, the file
was likely created as an SQL table. iNav or System i Navigator would
probably be your best bet to get the source for the table. (I don't have
the latest version of Access Client Services. It may have a good method to
retrieve SQL source for a table.)

As others have stated, you may need to post some code snippets and/or more
information for us to know exactly what you're trying to do--and how we
can help.

[*] Traditional COBOL I-O (READ and WRITE statements) generally use the
term "File" for traditional read/write I-O and table for SQL I-O generally
uses the term "Table".

Michael Quigley
Computer Services
The Way International
www.TheWay.org

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.