Midrange News for the IBM i Community

Posted by: WestCoastGuy
Help with stmf statement
has no ratings.
Published: 16 Feb 2012
Revised: 23 Jan 2013 - 4055 days ago
Last viewed on: 01 Mar 2024 (5710 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Help with stmf statement Published by: WestCoastGuy on 16 Feb 2012 view comments(4)

I am trying to send an iseries DB file to another server in text, non-iseries on our system network.

Here is my code - why am I getting that error message and am I even using the right process?

CPYTOSTMF FROMMBR('XXXXXJRT5') TOSTMF('\\pcts080157.amre.com\AS400Logs\xxxxxjrt5.txt') STMFOPT(*ADD) STMFCODPAG(*PCASCII)                        
Object not a QSYS.LIB object.  Object is /XXXXXJRT5.                    
Object not copied.  Object is XXXXXJRT5.                 


Thanks in advance!                

Return to midrangenews.com home page.
Sort Ascend | Descend


(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Comment on: Help with stmf statement
Posted: 12 years 13 days 20 hours 56 minutes ago

That stmt would copy it to the IFS, not to another system.

Why not just FTP it? FTP would handle the EBCDIC to ASCII conversion.

Posted by: WestCoastGuy
Premium member *
Comment on: Help with stmf statement
Posted: 12 years 13 days 20 hours 44 minutes ago

Ok , Bob, that is what I will do.



Posted by: DaleB
Premium member *
Reading, PA
Comment on: Help with stmf statement
Posted: 12 years 13 days 19 hours 28 minutes ago
Edited: Thu, 16 Feb, 2012 at 15:24:38 (4397 days ago)

Like Bob said, FTP can handle it directly.

For reference, the FROMMBR is the IFS name, '/QSYS.LIB/somelib.LIB/XXXXXJRT5.FILE/XXXXXJRT5.MBR'.

If your file has packed or binary fields, you can't really FTP as text, and CPYTOSTMF won't work either. You'll need CPYTOIMPF.

Posted by: rgilsdor
Premium member *
Wayne, Michigan
Comment on: Help with stmf statement
Posted: 12 years 8 days 20 hours 30 minutes ago
Edited: Tue, 21 Feb, 2012 at 14:23:37 (4392 days ago)

1. The CPYTOSTMF command only works on source files or some like defined file.

2. You need to define the FROMMBR using the IFS style naming convention.

3. You cannot use the \\server target for the copy, but you can use the /QNTC/server style target if you have NetServer running and defined to your local network properly.


CPYTOSTMF FROMMBR('/qsys.lib/mylib.lib/mysrcf.file/mymbr.mbr')




The CPYTOIMPF works as well