× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Brilliant idea. Thanks,

When I run it in on the test side within the program it runs fine. The records get
coppied. When I run it on the live side within the program it doesn't copy the records.
When I run it on the live side from the cmd line it does copy the records.

CPYTOIMPF FROMFILE(ENVELOPE) TOSTMF('/tmp/ALEXANDER.xml'
) MBROPT(*REPLACE) TOCCSID(437) RCDDLM(*CRLF) DTAFMT(*FIXED)

I don't see what the difference is between running the cmd inside the program and
from the cmd line with everything else being equal.

Thanks,

Gary Kuznitz

On 5 Apr 2013 at 23:28, Bradley (Bradley Stone <midrange-l@xxxxxxxxxxxx>)
commented about Re: Data not getting written to /tmp:

Debug the program

Right after the command is built, eval it. Copy and past the command that
is run. This means the entire command with all the values replaced, etc.
The exact command that is run.

Paste it to a command line. Press enter. See what happens. That will
tell you what's going on.

A lot of times it is assumed you created the command right, but until you
debug it and see what's wrong you'll never know why the error is happening

Brad
www.bvstools.com


On Fri, Apr 5, 2013 at 11:17 PM, Gary Kuznitz <docfxit@xxxxxxxxxxxx> wrote:

** I changed the Callp to Call 'QCMDEXC'
And I am getting more info in the joblog now.

I don't know why the system is creating this file in QTEMP

File QACP173785 created in library QTEMP.

And then I get this error:
40 04/05/13 19:11:17 QC2IO QSYS *STMT QCPEXPRT
QSYS
From module . . . . . . . . : QC2RIOC1
From procedure . . . . . . : _Ropen
Statement . . . . . . . . . : 28
To module . . . . . . . . . : QCPEXPRT
To procedure . . . . . . . : Check_tofile_parameter
Statement . . . . . . . . . : 1130 *PRCLT
Message . . . . : File is not opened.
Cause . . . . . : 1. You attempted to open a file for reading, but the
file
does not exist. 2. You attempted to open a file for an output
operation, but
the library does not exist. 3. You attempted to close a file that is
not
open. 4. The open function ran out of internal memory. Recovery . . .
:
1. When you use fopen or freopen, specific information on the exception
message is contained in _EXCP_MSGID declared in <stddef.h>. 2. When
you use
_Ropen, handle I/O exceptions by specifying a signal handler for the
SIGIO
signal. Technical description . . . . . . . . : The value of errno
is set
to ENOTOPEN.

Message . . . . : Database file member copied to object.
Cause . . . . . : Database file member
/QSYS.LIB/QTEMP.LIB/QACP173785.FILE/QACP173785.MBR successfully copied to
object /tmp/ALEXANDER.xml in code page 37.

From module . . . . . . . . : QCPEXPRT
From procedure . . . . . . : Send_type_msg
Statement . . . . . . . . . : 2781
To module . . . . . . . . . : UULABELENV
To procedure . . . . . . . : UULABELENV
Statement . . . . . . . . . : 39800
Message . . . . : All records copied from file ENVELOPE in KDICHANGES.

I hope someone on the list will know why the error comes up. Maybe that's
why there
aren't any records written to the Tmp folder.

Thanks,

Gary Kuznitz

On 4 Apr 2013 at 15:54, Gary (Gary Kuznitz <midrange-l@xxxxxxxxxxxx>)
commented
about Data not getting written to /tmp:

Within an RPG program I am trying to copy a i5 file to the IFS. This
same program
writes i5 information to the file. The file gets created in /tmp but
the information
doesn't get written. This is my code:
D Path s 11 Inz('/tmp/')
C Eval CMDA = 'CPYTOIMPF ' +
C 'FROMFILE(ENVELOPE) '+
C 'TOSTMF('''+
C %Trim(Path)+
C %TRIM(LastFirst)+
C '.xml'') '+
C 'MBROPT(*REPLACE) '+
C 'TOCCSID(437) '+
C 'RCDDLM(*CRLF) '+
C 'DTAFMT(*FIXED)'

* Copy XML file to /tmp
** I changed the Callp to Call 'QCMDEXC'
C Eval CmdLength = %Len(%Trim(CmdA))
C Call 'QCMDEXC' 50
C parm cmda
C parm cmdlength
* Change Authorty on XML file
C Eval CMDA = 'CHGAUT ' +
C 'OBJ('''+
C %Trim(Path)+
C %TRIM(LastFirst)+
C '.xml'') '+
C 'USER(*PUBLIC) '+
C 'DTAAUT(*RWX)'

This is the authority I have for the /tmp folder

Work with Authority

Object . . . . . . . . . . . . : /tmp
Owner . . . . . . . . . . . . : QSYS
Primary group . . . . . . . . : *NONE
Authorization list . . . . . . : *NONE

Data -------------Data Authorities-------------
Opt User Authority Objopr Read Add Update Delete Execute

*PUBLIC *RWX X X X X X X
QSYS *RWX X X X X X X

This is the authority on the i5 file that is written to and copied from
in this program:

Display Object Authority

Object . . . . . . . : ENVELOPE Owner . . . . . . . : QPGMR
Library . . . . . : KDICHANGES Primary group . . . : *NONE
Object type . . . . : *FILE

Object secured by authorization list . . . . . . . . . . . . : *NONE

Object
User Group Authority
QPGMR *ALL
*PUBLIC *ALL

Does anyone have any idea why the data wouldn't be written to the file?

Thanks,

Gary Kuznitz


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