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



Jeff,

Isn't a key data structure the correct way to replace a KLIST? For example:

D Cust_Key DS likerec(MYFMT: *key)
/free
Chain %kds(Cust_Key) VArCust;
/end-free

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jeff Young
Sent: Tuesday, September 08, 2009 12:56 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Free Form I/O with list of fields does not checkl the length of the field vs key of file

I have recently noticed that when using the free format op codes for file i/o, that the compiler does not seem to be testing the length of the fields in my list vs the attributes of the field in the file, but in fixed form, using a klist, it checks the data type and length..

The following code shows the condition:
H option(*srcstmt)                                     
FVArCust   IF   E           K Disk                     
D Comp            S              2  0                  
D Cust            S             12A                    
 /Free                                                 
  Chain (Comp : Cust) VArCust;                         
 /End-Free                                             
C     Cust_Key      Klist                              
C                   KFld                    Comp       
C                   KFld                    Cust       
                                                       
C     Cust_Key      Chain     VArCust                  
C                   Eval      *InLR = *On              
C                   Return                             
 

File VARCUST has 2 key fields:
Company - Packed 2.0
Customer - Character 7A

When I compile this program, I get the following error/diagnostic messages:
          A d d i t i o n a l   D i a g n o s t i c   M e s s a g e s                 
 Msg id  Sv   Statement    Message text                                               
*RNF7066 00        000200  Record-Format ARCUSTR not used for input or output.        
*RNF7073 30        001200  KFLD at sequence number 1000 is 12 long. Key field is 7     
                           long.                                                                                                  


Obviously, this is a mistake in coding, and the cust field should have been defined as 7A, but if the compiler does not catch it, it can take a while to figure out what is wrong when debugging the program.

I have not found anything in the manual that indicates that this is normal behavior for free format i/o.
Has anyone else noticed this condition?
I am at V5R4M5.
I do not know what PTF level the system is at.

Thanks,

Jeff Young
Sr. Programmer Analyst
IBM -e(logo) server Certified Systems Exper - iSeries Technical Solutions V5R2 
IBM  Certified Specialist- e(logo) server i5Series Technical Solutions Designer V5R3
IBM  Certified Specialist- e(logo)server i5Series Technical Solutions Implementer V5R3

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.