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



     Jim, 
     
     I think you will have problems doing this with based structures. If 
     your intent is to save this record to compare against other records 
     from this file, then the based storage probably won't be holding 
     the first record anymore anyway. KISS rule applies here. Try:
     
     FINRECX    IF   E                K DISK
     
     *** External Data Structure for INRECX Header Record ***
     D INRecxHd_DS   E DS                  ExtName(INRecx) Prefix(HD)
     
     C                   Read      INRecX
     C                   Eval      INRecxHd_DS = INRecX
     
     Make a copy of your buffer and simply copy the record. The 
     subfields in the INRecxHd_DS data structure will be prefixed with 
     HD so the external data structure can be declared.
     
     
     hth
     Eric


______________________________ Reply Separator
_________________________________
Subject: Semantics
Author:  "Jim Langston" <SMTP:jimlangston@conexfreight.com> at EXCHANGE
Date:    12/26/00 5:31 PM


This is just a question of semantics I guess.
     
I need to call up the first record to a file and save it to a buffer, 
so that I can throw it back later, which is a header record (I didn't 
design the database files, I would of made them normalized myself).
     
I could open it internally described, give it a buffer, than declare in 
the D specs external declarations for it being the same name as the file.
     
But, I was hoping to open it externally described, creating a buffer
variable 
and pointing it to the beginning of the record.  My question becomes,
however, 
where do I point the variable?  That is this works for internally described:
     
FINRECX    IF   F  240        DISK
     
 *** External Data Structure for INRECX Header Record ***
D INRecxHd_DS   E DS                  ExtName(INRecx)
D                                     Based(INRecxHd_DS@) 
D INRecxHd_DS@    S               *
     
IINRECX    NS
I                                  1  240  INRecxBuffer
     
C                   Eval      INRecxHd_DS@ = %Addr(INRecxBuffer)
     
As you can see, I point INRecxHd_DS@ to the address of my buffer declared 
in my I specs.
     
Doing it this way, however...
     
FINRECX    IF   E             DISK
     
 *** External Data Structure for INRECX Header Record ***
D INRecxHd_DS     S                   INRecxBuffer
D                                     Based(INRecxHd_DS@) 
D INRecxHd_DS@    S               *
     
C                   Eval      INRecxHd_DS@ = %Addr(??????????????)
     
I'm going to try experimenting with this, and I'm sure that I could use 
the first variable in the file description, but my concern is what happens 
in the future when someone comes and sticks a new variable up front?  Or 
renames the variables?  Then my program won't work anymore 'til fixed.
     
And, yes, I understand that if they did that my buffer would have to be 
increased in size anyway.
     
Regards,
     
Jim Langston
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com. 
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com 
+---
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

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.