It looks to be the field XHDATE. You are trying to put a 6 digit field into a 2 digit field.  XHDATE is defined as packed 2 0.  Either make it a packed 6 0 field or change the data stream to be:
55505, '1', 0, 'H', '55505', 20, 09, 0804, 092444, 090428, 513, 'ES', 'CRAYOLA', 'CRAYOLA', 'CTR0361141003', '0', 20090424, ' ', 0, ' ', 3400, ' ', ' ', ' '
George Van Eaton
Clinical Programmer Analyst
Healthcare Management Systems, Inc.
3102 West End Avenue
Suite 400
Nashville, Tennessee 37203
(615) 383-7300 Ext.7007
Fax (615) 386-6662
gvaneaton@xxxxxxxxx
http://www.hmstn.com
HMS welcomes your feedback on our service. If there are any areas we can improve, please email our Quality Service Department at mailto:hmsquality@xxxxxxxxxx If you receive STAR service, please email mailto:hmsstar@xxxxxxxxx and tell us about your experience. We appreciate your business.
CONFIDENTIALITY STATEMENT: The documents accompanying this transmission may contain confidential health information that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party unless required to do so by law or regulation and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or action taken in reliance on the contents of these documents is strictly prohibited. If you have received this information in error, please notify the sender immediately and arrange for the return or destruction of these documents.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark Walter
Sent: Tuesday, August 04, 2009 8:39 AM
To: Midrange Systems Technical Discussion
Subject: CPYFRMIMPF Failing for Reason Code 9
All,
I am having an issue with CPYFRMIMPF. I have a VB program that creates a delimited file. I'm trying to use CPYFRMIMPF to copy the data into an iSeries database file. I'm getting a failure because of reason Code 9,   9 - The data for the field *N is not valid for the data type of the
 TOFILE.
Is there any way to see for which field the data is not valid?
Here is the data stream:
55505, '1', 0, 'H', '55505', 20, 090804, 092444, 090428, 513, 'ES', 'CRAYOLA', 'CRAYOLA', 'CTR0361141003', '0', 20090424, ' ', 0, ' ', 3400, ' ', ' ', ' '
Here is the file layout:
01 XHCNTR      Packed        5   0
02 XHTRNS      Char          1
03 XHDST#      Packed        2   0
04 XHRECD      Char          1
05 XHBOL#      Char         15
06 XHBLCC      Packed        2   0
07 XHDATE      Packed        2   0
08 XHHHMM      Packed        4   0
09 XHYMD       Packed        6   0
10 XHHM        Packed        4   0
11 XHTIMZ      Char          2
12 XHEDIC      Char         17
13 XHEDI2      Char         17
14 XHCPO       Char         22
15 XHRELS      Char         15
16 XHPODT      Packed        6   0
17 XHXREF      Char         15
18 XHMSWT      Packed       10   3
19 XHMSPC      Char          5
20 XHMSLQ      Packed        2   0
21 XHMSWQ      Char          1
22 XHMSUM      Char          2
23 XHMBOL#     Char         15
And here is the command I'm using:
 CPYFRMIMPF FROMSTMF('/home/mwalter/ob856hord.txt')
            TOFILE(X12856HORD)
            MBROPT(*REPLACE)
            RCDDLM(*CRLF)
            STRDLM('''')
BTW, I use this exact same procedure for another file, and it works just fine. This one has me really puzzled.
Thanks,
Mark
Mark Walter
Business to Business Data Integration Specialist Certified IBM System i Specialist Paragon Consulting Services, Inc mwalter@xxxxxxxxxxxxxxx
717-764-7909 ext. 126
--
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.
As an Amazon Associate we earn from qualifying purchases.