|
View previous topic :: View next topic
|
| Author |
Message |
Tyler Dunbar
New User
Joined: 17 Jul 2017 Posts: 4 Location: NW Arkansas
|
|
|
|
First time poster here, long time stalker.
Ive got a unsigned comp field (FIELD3) that Im converting to ZD but it is changing the value on the output file and I cant figure out why. Ive ran it both as a FI & BI input and same result. What am I missing here? Ive got several other columns where Im doing a similar conversion and not seeing this occurrence. Thanks in advance.
Input below.
FIELD1,1,2,CH
FIELD2,3,2,CH
FIELD3,5,4,BI
FIELD4,9,4,BI
etc...
BUILD=(FIELD1,
FIELD2,
FIELD3,TO=ZD,LENGTH=9,
FIELD4,TO=ZD,LENGTH=9,
ETC...
The decimal value of X'008D4A61' is 9259617.
OUTFIL FNAMES=F1,INCLUDE=(138,2,FI,EQ,2,AND,136,2,FI,EQ,1),BUILD=(*
1,2,3,2,5,4,FI,TO=ZD,LENGTH=9,141,2,FI,TO=ZD,LENGTH=3,9,*
| Code: |
----+----1----+----2-
*********************
US01 ý¢/ aDC €ST2
EEFF08460018CC0019EEF
42010DA1007143009F232
*********************
|
Output is changed to 9259616
| Code: |
----+----1----+-
****************
US01009259616092
**************** |
|
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
| I just ran a BUILD=(1,4,FI,TO=ZD,LENGTH=9) on the value X'008D4A61' in DFSORT and got the output of 009259617, so most likely something in the code you did not post is overlaying the last digit. Try running only that one conversion and see what value is output. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2288 Location: USA
|
|
|
|
| Tyler Dunbar wrote: |
| First time poster here, long time stalker. |
In your example the input record must have the length 12, while output to be 22 bytes long.
The data shown have length 21, and 16 bytes instead.
Please verify all your fields offset/size, and clarify this issue.
BTW, "BI,4" stands for signed binary, not for unsigned comp |
|
| Back to top |
|
 |
magesh23586
Active User

Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
| sergeyken wrote: |
BTW, "BI,4" stands for signed binary, not for unsigned comp
|
As per dfsort programming guide
Format code BI is Unsigned binary. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2288 Location: USA
|
|
|
|
| magesh23586 wrote: |
| sergeyken wrote: |
BTW, "BI,4" stands for signed binary, not for unsigned comp
|
As per dfsort programming guide
Format code BI is Unsigned binary. |
I'm sorry, you're right. I messed those BI/FI abbreviations. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|