|
Thanks Rich - works great. I should have known that but too blind to see... Jim Franz----- Original Message ----- From: "Rich Duzenbury" <rduz-midrange@xxxxxxxxxxxxxxxxxxx>
To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx> Sent: Saturday, February 18, 2006 12:53 PM Subject: Re: ifs file create has extra characters
On Sat, 2006-02-18 at 12:47 -0500, Jim Franz wrote:I am using Scott Klement's ifsebook examples and creating a ascii text file, code page 819. When I specify the file name is a text string ( like 'myfile.txt' it worked fine. If I put the value in a field, I end up with an extra character '>' in the file name. Have debugged this for quite a while and am sure that > symbol not in my field called "filename".Hoping someone (or Scott) can offer me a clue where I went wrong. * determine file name c eval filename = %trim(p1FilDir) + c %trim(p1PostUsr) + c %trim(p1FilSufix) c eval filename = %trim(filename) <clip> (debugged here & filename = 'mmcvv5.manifest' Create a new file, and assign it a code page of 819: c eval fd = open(filename: c O_CREAT+O_WRONLY+O_CODEPAGE: c S_IWUSR+S_IRUSR+S_IRGRP+S_IROTH: c 819)The > in the display is letting you know that the filename is longer than can be displayed. Specifically, the file you created is most likely called 'myfile.txt ' If filename is a character field, it is blank filled. So, even if you trim it, it is still blank filled. Trim the filename at open time: eval fd = open(%trim(filename) : ...
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.