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




Thanks a lot Rob.



I finally discovered the problem...But it was not mentioned in the joblog...



The program works fine the first time because, the XLS sheet generated is new.

When I opened the XLS sheet generated in the IFS folder to review the data, I forgot to close it.



So when I re-called my CL program again, the CPYTPIMPF fails (because the program can not replace XLS sheet - as it is in use with me) :-)

It was my mistake...but I took me a long time to discover!!





Thanks again for your help.



Dina



To: midrange-l@xxxxxxxxxxxx
Subject: Re: CPF2817 from CPYTOIMPF - No records copied from file - but the file contains dta
From: rob@xxxxxxxxx
Date: Tue, 2 Mar 2010 15:35:58 -0500

If you do a DSPJOBLOG you should see the message that spawned the CPF2817.

DSPMSGD CPF2817
Message ID . . . . . . . . . : CPF2817
Message file . . . . . . . . : QCPFMSG
Library . . . . . . . . . : QSYS

Message . . . . : Copy command ended because of error.
Cause . . . . . : An error occurred while the file was being copied.
Recovery . . . : See the messages previously listed. Correct the
errors,
and then try the request again.


Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: dina ramzy <dina.ramzy@xxxxxxxx>
To: <midrange-l@xxxxxxxxxxxx>
Date: 03/02/2010 02:43 PM
Subject: CPF2817 from CPYTOIMPF - No records copied from file - but
the file contains dta
Sent by: midrange-l-bounces@xxxxxxxxxxxx




Dear All,



I have a CL program that calls an RPGSQLE program.



The RPG program generates two files [hdrfile and dtafile]

The CL program should copy the two files to IFS using CPYTOIMPF



The problem is the CL runs fine only the first time. The second time I
got:

No records copied from file HDRFILE in MYLIB

CPF2817 received by procedure CLPGM



When I check the HDRFILE, I find that there is one record inside it (which
is correct) ...

Can you please advise me why the stmt below is giving this exception msg
CPF2817 - and how can I solve this ?

CPYTOIMPF FROMFILE(HDRFILE) +
TOSTMF(&FILENAME) MBROPT(*ADD) +
STMFCODPAG(*PCASCII) RCDDLM(*CRLF)



Please find the code of the 2 programs below



Thanks you in advance,



Dina





RPGPGM

=========

C/Exec SQL
C+ Set Option Commit=*NONE, DatFmt=*ISO, DynUsrPrf=*Owner, DlyPrp=*YES
C/End-Exec

C/EXEC SQL
C+ drop table mylib/hdrfile
C/END-EXEC

C/EXEC SQL
C+ create table mylib/hdrfile as
C+ (select 'EMP_NAME' as col01,
C+ 'Birth_date' as col02,
C+ 'Male/Female' as col03,
C+ 'Hire_date' as col04

C+ from qsqptabl)
C+ with data
C/END-EXEC



C/EXEC SQL
C+ drop table mylib/dtafile
C/END-EXEC

C/EXEC SQL
C+ create table mylib/dtafile as (
C+ select fld1,
C+ fld2,
C+ fld3,
C+ fld4

C+ from prodtab )
C+ with data
C/END-EXEC

C seton lr





CL PROGRAM

============

PGM

DCL VAR(&FILENAME) TYPE(*CHAR) LEN(100) +
VALUE('/HOME/REPORTS/REP1')



CALL PGM(RPGPGM)


CHGVAR VAR(&FILENAME) VALUE(&FILENAME *TCAT '.CSV')

CPYTOIMPF FROMFILE(HDRFILE) +
TOSTMF(&FILENAME) MBROPT(*REPLACE) +
STMFCODPAG(*PCASCII) RCDDLM(*CRLF)
CPYTOIMPF FROMFILE(DTAFILE) +
TOSTMF(&FILENAME) MBROPT(*ADD) +
STMFCODPAG(*PCASCII) RCDDLM(*CRLF)

RCLRSC
CHGAUT OBJ(&FILENAME) USER(*PUBLIC) DTAAUT(*R)

ENDPGM







_________________________________________________________________
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
https://signup.live.com/signup.aspx?id=60969
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969

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.