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



This is a multi-part message in MIME format.
--
--
[ Picked text/plain from multipart/alternative ]

----- Original Message -----
From: Frank W. Kany IV
To: rpg400-l-request@midrange.com
Sent: Thursday, May 09, 2002 3:11 PM
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

Below is a query output I ran on the file.

--
[ weird data.gif of type image/gif deleted ]
--




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.