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 - 4110 days ago
Last viewed on: 23 Apr 2024 (5771 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: 12 years 2 months 9 days 12 hours 27 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 2 months 9 days 12 hours 14 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: 12 years 2 months 9 days 10 hours 59 minutes ago
Edited: Thu, 16 Feb, 2012 at 15:24:38 (4452 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 2 months 4 days 12 hours ago
Edited: Tue, 21 Feb, 2012 at 14:23:37 (4447 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)