Convert negative numbers from flat files e.g. -12345

Eric Lehti

VIP Member
What is your preference when receiving unformatted flat files that may possibly contain negative numbers as well as positive numbers to be imported into JDE files?

Do you know if JDFSRC/JDECPY has a routine that converts unformatted negative numbers found in flat files?
Example: columns 1-11 of the flat file is reserved for the number. We assumed the number would always be positive, never negative, and the sender was willing to fill the field with leading zeros to the left of the number. e.g. 00987654321 is 9,876,543.21
The sender will soon begin sending negative numbers (invoice credits).

Is is easier to reserve a position of the record to identify the negative number and then code:
<begin code>
NegID IFEQ '-'
Z-SUB number JDEFIELD
ELSE
Z-ADD number JDEFIELD
ENDIF
</end code>

Or do you prefer to code for a floating hyphen (that could be anywhere in columns 1 through 10).
This need has become evident in the process descrived below.
The bank has just begun to send us their 80-byte flat file that we FTP up to F03551 (Bank Lock box).
F03551 is processed by P03551, and writes to F0312 (Batch A/R Cash Application).
F0312 is subsequently processed by P03550 and writes to F0311 (Accts Receivable Ledger).
Thanks in advance, everyone.
 
fencebuilder,

I have done some of these. I found it easier to reserve a position to the right of the number for a negative sign. "-" or whatever you want to use.

Positive numbers that have nothing in that field, can just be moved. But I multiply the negative numbers (ones with something in that field) by -1 to reverse their sign, thereby making them negative to get them into JDE.

Just my personal preference.

Good luck.

/lf
 
Back
Top