|
My experience with variable length fields is they save DASD, nothing else. The AS400 data base manager seems to pad the buffers with blanks in rpg III & IV. We have one such beast, a documentation file where that want to write a book in a single record, yet most of the time only type 30-40 characters. Changing the record from fixed @ 700 bytes to variable saved 70% +- disk space on the millions of records we have. But within the programs, the fields are padded with blanks to the max defined length of the field. Christopher K. Bipes mailto:ChrisB@Cross-Check.com Sr. Programmer/Analyst mailto:Chris_Bipes@Yahoo.com CrossCheck, Inc. http://www.cross-check.com 6119 State Farm Drive Phone: 707 586-0551 x 1102 Rohnert Park CA 94928 Fax: 707 586-1884 -----Original Message----- From: Ravi Viswanathan [mailto:ravi@spacestar.com] Sent: Wednesday, June 30, 1999 11:53 AM To: RPG400-L@midrange.com Subject: Question about VARYING fields in RPG IV Hello, Can someone explain how VARYING fields work? I have defined a VARYING field in an RPG IV/embedded SQL program as follows: ITEM S 25A VARYING. I execute the SQL statement and retrieve a value into variable ITEM. The length of the value returned could vary from 5 to 25. I then use variable ITEM, in another SQL select statement to retrieve data from Oracle using Oracle Access Manager. The field that I am selecting against, is defined as VARCHAR in Oracle. The problem is that field ITEM retains trailing blanks at the end when the the value is shorter than 25. Consequently I don't find a hit in Oracle. So, I have to %TRIM variable ITEM before using this variable to retrieve from Oracle. I have the program working but - shouldn't a VARYING field by definition drop trailing blanks. Otherwise what is the advantage in defining a field as VARYING. Why not just go with a standard alpha field definition ? Thanks * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This is the RPG/400 Discussion Mailing List! To submit a new * * message, send your mail to "RPG400-L@midrange.com". To unsubscribe * * from this list send email to MAJORDOMO@midrange.com and specify * * 'unsubscribe RPG400-L' in the body of your message. Questions should * * be directed to the list owner / operator: david@midrange.com * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This is the RPG/400 Discussion Mailing List! To submit a new * * message, send your mail to "RPG400-L@midrange.com". To unsubscribe * * from this list send email to MAJORDOMO@midrange.com and specify * * 'unsubscribe RPG400-L' in the body of your message. Questions should * * be directed to the list owner / operator: david@midrange.com * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
As an Amazon Associate we earn from qualifying purchases.
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.