View previous topic :: View next topic
|
Author |
Message |
jdesouza
New User
Joined: 29 May 2006 Posts: 2 Location: Brasil
|
|
|
|
Hi experts;
I´m a newbee in Easytrieve and have a responsability to convert lots of data in datasets (obviously ) in CSV format, but i have trouble with packed fields signed. Let me show an sample job:
Code: |
//JOBCARD
//*----------------------------------------------------------------
//*-- EZTPLUS PROC CALLING "EZTPA00"
//*----------------------------------------------------------------
//STEP02 EXEC EZTPLUS,H=YES,DV=CYL,N=80
//SYSPRINT DD SYSOUT=Y
//SYSIN DD *
LIST OFF
PARM LIST NOPARM
FILE INPUT
IN-PRECO-ITEM 1 7 P 2
*
FILE OUTPUT
OUT-PRECO-ITEM 1 13 N 2
*
JOB
OUT-PRECO-ITEM = IN-PRECO-ITEM
SEPARATOR = ';'
*
PUT OUTPUT
//INPUT DD DSN=IR.INPUT.FILE,DISP=SHR
//OUTPUT DD DSN=IR.OUTPUT.FILE,DISP=SHR
|
My desire is read the number "-110803282" from this packed "hex on" register.
Code: |
ORIGINAL NUMBER : "-110803282"
HEX ON
>....5..
0010022
001838D
_____________
|
But, the output results is "000011080328K;"
It´s translating "2D" to "K"...
Am I doing something wrong ??? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
No, the system is doing EXACTLY what you told it to do. If you look at the character K in the EBCDIC collating sequence, it is D2 -- which is a zoned decimal negative 2 value. |
|
Back to top |
|
|
jdesouza
New User
Joined: 29 May 2006 Posts: 2 Location: Brasil
|
|
|
|
Hi Robert.. thanks for your answer..
So, when we extract a Packed field these behavior is expected ?
I mean, there is no way to "automatic" translate :
0010022
001838D to -110803282 ??
Will i have to check each zonal decimal negative value, translating to the format that i want ? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Look at the EDIT MASK capability of Easytrieve -- the specific mask you will use will depend upon whether or not you want the leading zeros and the negative sign in a fixed position or not.
Quote: |
My desire is read the number "-110803282" from this packed "hex on" register. |
Actually, no this is not your desire -- you want a HUMAN READABLE value to be output, which is EXTREMELY different from what you originally asked for. As indicated, you were reading the number value correctly -- you merely were not correctly interpreting the results Easytrieve gave you. |
|
Back to top |
|
|
|