[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: [sqr-users] Size of flat file



In this particular case, there will be no effect upon your program, however it 
it had been the reverse (400 on the Open and 301 on the Read) you would have 
encountered some truncation.

I believe that the length specified on the open is used on some platforms by 
the O/S to validate that the (maximum) length specified matches the entry in 
the file header (on an open for read) or to establish the file header on the 
media for an open for write.

The length specifies how much of the record in the buffer will be moved to the 
specified variable. So, if the open had specified 400 but your read only 301, 
up to 99 bytes at the end of your record would be truncated as it was moved 
into $record. In some instances this may be exactly what you want to do if you 
had a huge record but were only interesting in looking at the first few fields.


>>> radhika_05@hotmail.com 2005/06/24 11:30:13 >>>
Hi,

   I never thought that there would be difference in specifying the flat 
file size in first statement and second statement. But I see that the size 
in first statement is 301 and in second it is 400. what is the difference?


Statement 1:      OPEN $filename1  AS 10
                        FOR-READING
                        RECORD=301:VARY
                        STATUS = #OPEN1

Statement 1:     while 1 = 1
                        read 10 into $record:400

Thanks

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ 


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org 
http://www.sqrug.org/mailman/listinfo/sqr-users


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users