CPYFRMIMPF Error Code 2

105 pts.
Tags:
AS/400
RPG
Hello, Can someone help me here? I'm trying to import data into a physical file using cpyfrmimpf and I keep getting error code 2 - The field A in the Field Definition File is not a field in the TOFILE. I've created the FDF from the physical file so the fields should be exactly the same. I'm trying to see if I'm missing something. Let me know if you would like to see any of the files I'm dealing with or if you have any suggestions: This is the command:
CPYFRMIMPF FROMSTMF('/BetaRaven/Sum3.asc') TOFILE(BRCOMMLIB/BRSUM3P) 
 RCDDLM(*ALL) 
 DTAFMT(*FIXED)  
RMVBLANK(*NONE) 
 FLDDFNFILE(BRCOMMLIB/QDDSSRC BRSUM3P)
This is the BRSUM3P physical File in Qddssrc in Library BRCOMMLIB:
A          R BRSUM3R                         TEXT('BR FORMULA MIXED')       
A            ARCHIVED       1A               TEXT('OBSOLETE')               
A                                                                     
A            PRODUCTION     6A          TEXT('BATCH CONTROL CODE')     
A                                                          COLHDG('BATCH' 'CODE')         
A                                                         ALWNULL                        
A            RUN_NUM        6A              TEXT('RUN CONTROL CODE')       
A                                                         COLHDG('RUN' 'CODE')           
A            AREA           2A                  TEXT('AREA BATCH PRODUCED')    
A                                                         COLHDG('AREA' 'PRODUCED')      
A            INGREDIENT    10A          TEXT('INGREDIENT LOT TRACKED') 
A                                                         COLHDG('INGREDIENT' 'TRACKED') 
A            FORMULA       10A            TEXT('THE RECIPE PRODUCED')    
A                                                       COLHDG('RECIPE')               
A            DATE           8A                TEXT('DATE USED')              
A                                                   COLHDG('DATE' 'USED')          
A            TIME           5A              TEXT('TIME USED')              
A                                                    COLHDG('TIME' 'USED')          
A            LOT           10A               TEXT('LOT CONTROL CODE USED')  
A                                                     COLHDG('LOT' 'CODE')           
A            QUANTITY       9A         TEXT('QUANTITY USED')          
A                                                     COLHDG('QUANTITY' 'USED')      
A            BIN            5A                 TEXT('BIN INGREDIENT')
Here is the FDF I'm using:
[Data Transfer File Description]
FieldCount=11
FileType=1
Version=2
[Options]
DateFormat=1
DateSep=1
DcmlSep=1
TimeFormat=1
TimeSep=1
[F0001]
Length=1
Name=ARCHIVED
Type=1
[F0002]
Length=6
Name=PRODUCTION
Type=1
[F0003]
Length=6
Name=RUN_NUM
Type=1
[F0004]
Length=2
Name=AREA
Type=1
[F0005]
Length=10
Name=INGREDIENT
Type=1
[F0006]
Length=10
Name=FORMULA
Type=1
[F0007]
Length=8
Name=DATE
Type=1
[F0008]
Length=5
Name=TIME
Type=1
[F0009]
Length=10
Name=LOT
Type=1
[F0010]
Length=9
Name=QUANTITY
Type=1
[F0011]
Length=5
Name=BIN
Type=1
Here is The SUM3.ASC There are more then 3 rows but some sample date I'm trying to pull in:
T021534002056B124        BS-220-61009/05/1606:14          00030.000M19  
T021534002056B184        BS-220-61009/05/1606:13          00018.400M11  
T021534002056B146        BS-220-61009/05/1606:14          00015.680M12


Software/Hardware used:
rpg as400
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

SOLVED: For anyone who runs into this situation: you need to create a basic text file on the as400 fill in the variables like this and use this as the FDF.  

INGREDIENT    16 25 N
FORMULA       26 35 N
DATE          36 43 N
TIME          44 48 N
LOT           49 58 N
QUANTITY      59 67 N
BIN           68 72 N

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: