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



I forgot about Jim's gem!  I remember when I saw it, I thought "If I ever
have to work with flat files again..."  Well, here I am!  :(

Still, the push I'm making here for one of our clients that still uses a
S/36 package is to externally describe all the flatfiles as I come across
them in any new or modification development.  Just not sure what the caveats
are, if any, for doing that.  Anybody have an RTFM that discusses potential
gotchas for externalizing flatfiles?  How about alternate indexes?  The key
would have to be that I wouldn't be required to recompile any program that
uses a newly-converted-to-externally-described file.

It's been too long, so I mismember.

- Dan Bale
(I am *NOT* "Dale"
http://archive.midrange.com/midrange-l/200105/msg00281.html )
SAMSA, Inc.
989-790-0507
DBale@SAMSA.com <mailto:DBale@SAMSA.com>
  Quiquid latine dictum sit altum viditur.
  (Whatever is said in Latin seems profound.)

-----Original Message-----
From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On
Behalf Of Frank W. Kany IV
Sent: Thursday, May 09, 2002 3:15 PM
To: RPG Mailing List
Subject: program defined Input file - examples please

I have a physical file that has "funky" data in it.  I was told I had to
internally define the file in my RPGIV program because the program would
"bomb" if I were to do a READ operation on the file.  I've never done this.
I've always used externally described files.  Does anyone have an example of
internally describing a file?  When it's internally defined, can the program
do operations such as SETLL and READE or do I have to read each record to
find the record I want?  I found the following code from Jim Langston in the
midrange archives:

============================================
When you open the file in your program open it like this:

FARFILE    UF   F  222        DISK

D FileNM_DS     E DS                  ExtName(ARFileNM)
D                                     Based(FileNM_DS@)
D                                     Prefix(NM_)
D FileNM_DS@      S               *

IARFile    NS
I                                  1  222  ARBuffer

C     *InzSR        BegSR
C
C                   Eval      FileNM_DS@ = %Addr(ARBuffer)
C
C                   EndSr


Where:
ARFILE = Your existing file with data
ARFileNM = Your new empty file with correct DDS
===============================================

Is the above code the easiest way to internally define a file.  If so what
would the READ or SETLL operation look like.

TIA,

Frank



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.