× 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.



At 08:14 10/23/2001, Denis Robitalle wrote:
>Hello all,
>
>In our effort to eliminate our S36 code, I was ask to develop a command to
>replace the BLDFILE instruction. This command will do some extra
>processing for us. My problem is the following: I have no problem creating
>a sequential file without a DDS source member but I do not know how to
>create a keyed file without a DDS source member. The CRTPF command does
>not offer me the option to specify a key.

You could create and compile a temporary source member based on the
positional parameters, like this:

          R R<pfname>
            F0001       10
            K0001        7
            F0002       15
            K0002        3
            F0003       93
          K K0001
          K K0002

This would create a physical file with a record length of 128 bytes, and a
non-contiguous key in positions 11-17 and 33-35. It's more or less, what
the S36EE BLDFILE command does.

A more database-centric solution would be to create your files with DDS
defining all of the fields, and work on eliminating delete-create logic.
You could accomplish that by transparently replacing deletes with CLRPFMs
and BLDFILES with CHKOBJ followed by either CRTPF or CLRPFM, depending on
whether or not the object already exists. This would have the added
advantage of allowing new programs to use external data definitions, which
really are vastly superior to the program described RPG II variety, while
the old programs can go on happily doing whatever it is they do. The
problem you'll end up with using this approach though, is S36 programs that
create ?WS? files. You could end up with a LOT of unnecessary files, unless
you're careful to create them in QTEMP, or make sure to clean them up later.

Pete Hall
pbhall@execpc.com
http://www.execpc.com/~pbhall/



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.