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 - 2124 days ago
Last viewed on: 17 Nov 2018 (4288 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

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Help with stmf statement
Posted: 6 years 9 months 1 days 19 hours 47 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: 6 years 9 months 1 days 19 hours 35 minutes ago

Ok , Bob, that is what I will do.

 

THanks!

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Help with stmf statement
Posted: 6 years 9 months 1 days 18 hours 19 minutes ago
Edited: Thu, 16 Feb, 2012 at 15:24:38 (2466 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: 6 years 8 months 26 days 19 hours 21 minutes ago
Edited: Tue, 21 Feb, 2012 at 14:23:37 (2461 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')

TOSTMF('/QNTC/otherserver/othershare/filename.txt')

STMFOPT(*ADD) STMFCCSID(*PCASCII)

 

The CPYTOIMPF works as well

CPYTOIMPF FROMFILE(MYLIB/MYFILE) 

TOSTMF('/QNTC/otherserver/othershare/filename.txt')

RCDDLM(*CRLF) DTAFMT(*FIXED)