×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




As is usually the situation, you're not deleting the trailing blanks. Remember
you're dealing with functions that are expecting C null-terminated strings.
Use %TrimR(filename) on the open() function and it should work.

-Bob Cozzi
www.RPGxTools.com
RPG xTools - Enjoy programming again.


-----Original Message-----
From: rpg400-l-bounces+cozzi=rpgiv.com@xxxxxxxxxxxx
[mailto:rpg400-l-bounces+cozzi=rpgiv.com@xxxxxxxxxxxx] On Behalf Of Jim Franz
Sent: Saturday, February 18, 2006 11:47 AM
To: RPG400-L@xxxxxxxxxxxx
Subject: ifs file create has extra characters

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)                              

this is created file name:   
 
Object link            Type 
mmcvv5.manifest    >   STMF 

this is Scott's copybook entries and i have not altered any
H DFTACTGRP(*NO) ACTGRP(*NEW) BNDDIR('QC2LE') BNDDIR('IFSTEXT')      
                                                                     
D/copy IFSEBOOK/QRPGLESRC,IFSIO_H                                    
D/copy IFSEBOOK/QRPGLESRC,ERRNO_H                                    
D/copy IFSEBOOK/QRPGLESRC,IFSTEXT_H                                  

my defined field
D filename        s             80a   inz                                  File
Name to create 

jim franz

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