Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use CPYTOSTMF to copy a file from as400 to IFS

Status
Not open for further replies.

jadec

MIS
Jan 22, 2004
87
0
0
US
Hi Guys,

I try to use CPYTOSTMF to copy a file to a directory. I got a error : Code page attribute does not match STMFCODPAG. My code is:
Code:
 CPYTOSTMF FROMMBR('qsys.lib\mylib.lib\myfile.file\mymbr.mbr') TOSTMF('home\mydir\myfile.txt') STMFOPT(*replace) STMFCODPAG(*PCASCII)

If i copy to 'QDLS/mylib/myfile.txt' works fine.

Anyone know what is wrong of my code please? Thanks

 
If the stream file exists, this option is valid only if the code page associated with the stream file is the same as the specified value. Otherwise, the operation will fail.
I think that codepage of your stmf not same with *PCASCII

 
Hi rotebor,

I don't understand what is codepage. But anyway, Do you have any solution?

Thank you !

 
You can delete the target file and let CPYTOSTMF re-create it for you. After the first time, it should work from then on. It will be created with a Windows-compatible code page (if you use STMFCODPAG(*PCASCII) ).

From CPYTOSTMF's help for the STMFCODPAG(*PCASCII) parameter option:

Code:
If the stream file exists, this option is valid only if the code page associated with the stream file is the same as the specified value.  Otherwise, the operation will fail.                                                                                     
If the stream file does not exist, a code page in the Microsoft Windows encoding scheme (x4105) is computed. 

This code page is associated with the target stream file and is used for data conversion if it is requested.  This option allows the resulting data to be used by Microsoft Windows applications.

Me transmitte sursum, Caledoni!

 
Thank you flapeyre, It works fine after i delete the stream file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top