|
Bob do I still need to add this to FileName when FileName is defined as 35 characters and every single character position will be taken up? I will always have 35 characters. Michael Schutte Admin Professional Bob Evans Farms, Inc. 3776 South High Street, Columbus, OH 43207 Phone: 614/492-7419 Fax: 614/409-2017 Visit us on the web! www.bobevans.com (Embedded image moved to file: pic30191.gif) We've built a better hotcake -- Stacked and Stuffed Hotcakes -- coming January 11th! For hotcake tips, interviews with our chefs and more, check out the Stacked and Stuffed blog at http://imstuffed.blogspot.com "Bob Cozzi" <bob@xxxxxxxxxxxx > To Sent by: "'RPG programming on the AS400 / rpg400-l-bounces@ iSeries'" <rpg400-l@xxxxxxxxxxxx> midrange.com cc Subject 03/09/2007 10:45 RE: IFS Open Help... AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@midrang e.com> I'm sure Scott will help you get the logic and flags working, but I thought I'd mention that your code is wrong. That's when you pass a pointer, whether its pFileName or %addr(szFileName), a prototyped subprocedure parameter that is defined as follows: D pFileName * Value Options(*STRING) Does NOT convert the value into a null-terminated string. It only converts it when a text string is passed (i.e., when a non-pointer is passed). When a pointer is specified, it passes it right through without converting anything. So you have to add the X'00' to the end of the string. And you have to ensure that there are no trailing blanks in the field. So for your example, this might work: FileName = %trimR(FileName) + X'00'; pFileName = %addr(fileName); Of course the sequence of these _two_ statements means nothing. -Bob Cozzi www.i5PodCast.com Ask your manager to watch i5 TV -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Michael_Schutte@xxxxxxxxxxxx Sent: Friday, March 09, 2007 9:24 AM To: rpg400-l@xxxxxxxxxxxx Subject: IFS Open Help... I have this routine that's suppose to create a new IFS document (if already exists, I want to overwrite what's there). When I tested this program last week, it worked as expected. But now that it's in production, it's not working anymore. I've even moved the data from this morning to the test system to walk through the steps today still a no go. When I stepped through the program... FileName = '/html/imsinv/INV00100001676760.HTML' // this is correct. FileNamP = SPP:C71128539607BF90 // I assume this is correct. OFLAG = 16777282 OMODE = 511 CP = 819 but... open(FileNamP:Oflag:Omode:cp) = -1 I found in the archives that someone else needed to trim the FileName for the openFile() routine that they were using, I'm wondering though, do I need to have a trim about my FileNam on the FileNamP = %ADDR(FileNam) line? Well then again, the FileName will always be the same length of 35 characters. This process is new to me, please bear with me. Thanks, P.S. I am using the 'QC2LE' binding directory. BegSr CreateIFSDocument#; // This code was copied from the web, therefore, I'm // not quite sure how this all works. But I'll Try to // explain it to the best of my knowledge. *In99 = *Off; // Form the file name you want to create in the IFS. FileNam = IFSDir + 'INV' + DRGLCPY + %EditC(DRORD:'X') + '.HTML'; // This is new to me, but I believe that I'm telling // this field to point to the address of FileNam FileNamP = %ADDR(FileNam); // setup the OFlag to indicate that we want // this file to be write only and to truncate // left over data when the file already exists. // Again, I don't know how this works, but // O_WRONLY = write only, O_TRUNC = truncate. Oflag = O_WRONLY + O_TRUNC + O_TEXTDATA; // Open the file name requested. If open(FileNamP:Oflag:Omode:cp) = -1; perror(FileNamP); *In99 = *On; LeaveSR; EndIf; EndSr; Michael Schutte Admin Professional Bob Evans Farms, Inc. We've built a better hotcake -- Stacked and Stuffed Hotcakes -- coming January 11th! For hotcake tips, interviews with our chefs and more, check out the Stacked and Stuffed blog at http://imstuffed.blogspot.com -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
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.