ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

CPYFRMIMPF *TAB Unable to handle Comma in Numbers?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CPYFRMIMPF *TAB Unable to handle Comma in Numbers?

    When I execute the following code:

    Code:
    CPYFRMIMPF FROMSTMF(&LST_FILENAMES) +                   
                 TOFILE(QTEMP/FILELIST) MBROPT(*ADD) +     
                 RCDDLM(*CRLF) STRDLM(*NONE) +              
                 STRESCCHR(*NONE) RMVBLANK(*BOTH) +         
                 FLDDLM(*TAB) DECPNT(*PERIOD) DATFMT(*USA) +
                 TIMFMT(*HMS) RPLNULLVAL(*FLDDFT) +         
                 RMVCOLNAM(*YES)
    ...I get the following error:

    Code:
    The copy did not complete for reason code 7. 
    
      7 - The FROMFILE numeric field INVAMOUNT contains blank characters, or  
    other characters that are not valid for a numeric field.
    There were a total of 3 records (plus a header) in the tab file. The record that did not get copied had a comma in the invoice amount field (5,432.10). I don't recall having a problem with this before but it's very possible I have never processed numeric data with commas before. One of the values had a negative sign (-43.21) and it copied correctly.

    Am I missing something or is this the way it has always been?

  • #2
    Re: CPYFRMIMPF *TAB Unable to handle Comma in Numbers?

    Originally posted by TheZenbudda
    Am I missing something or is this the way it has always been?
    I think it's the way it's always been. Even though you're not using the comma to delimit fields, you still have to format numeric values according to certain rules (which I cannot find documented anywhere). No commas, minus sign must be leading, not trailing, etc.

    Comment


    • #3
      Re: CPYFRMIMPF *TAB Unable to handle Comma in Numbers?

      Thanks Ted. That was my suspicion. I know Scott K wrote some RPG API's for the IFS. The company I'm working for doesn't like to implement these types of solutions (unfortunately) and we are in a bind to "not" buy any software/support for a year. I'm fairly certain I asked this a long time ago on iprodeveloper. But since it "died", I couldn't find the thread.

      Comment

      Working...
      X