Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert alpha field that contains a neg num to a neg num field

Status
Not open for further replies.

Reaper73

Programmer
Jun 20, 2005
11
US
I have a flat file that I am moving into a file with defined fields(contains both alpha and numeric). Everything is working great until I hit a record that has a negative value in a position that contains only numbers that I'm moving into a numeric field. In that position the value looks like this 001024p or 000500w. BIF %dec doesn't work.
 
This procedure will do what you want.

If you are on V5R1 or earlier, the %DEC BIF doesn't convert character to numeric. Since we have to compile back to V5R1 (even though we are at V5R3), we use this instead, and it works just fine.

Solum potestis prohibere ignes silvarum.

 
Reaper73,
Why doesn't %dec work ? A sample of the input would be useful.
Also, what release are you on ?
 
I'm on V5R4.
In the attached file the position 31-40 contains dollar amounts and you can see some of them have a lower case letter in the last position. This is the negative sign with whatever number is supposed to be in that position. One other thing, this data is coming from a Unix system so the letters that signify a negative amount are going to be different than the letters the Iseries uses.
 
Reaper73:
You can't attach a file that's on your local drive or LAN. It has to be somewhere on the Internet.

Solum potestis prohibere ignes silvarum.

 
Umm ok. Well the data looks like this:

AP00002007101900000000123456700000001750w000000
AP00002007101900000000444444400000002340v000000
 
In that case. why don't you just do an %XLATE on the data to map the Unix sign letters to the equivalent EBCDIC sign?

Solum potestis prohibere ignes silvarum.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top