IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

READ A PACKED "NEGATIVE" FIELD WITH EASYTRIEVE


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jdesouza

New User


Joined: 29 May 2006
Posts: 2
Location: Brasil

PostPosted: Tue May 02, 2017 11:43 pm
Reply with quote

Hi experts;

I´m a newbee in Easytrieve and have a responsability to convert lots of data in datasets (obviously icon_rolleyes.gif ) 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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed May 03, 2017 12:15 am
Reply with quote

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
View user's profile Send private message
jdesouza

New User


Joined: 29 May 2006
Posts: 2
Location: Brasil

PostPosted: Wed May 03, 2017 12:45 am
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed May 03, 2017 1:02 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts PuTTY - "User is not a surrogate... IBM Tools 5
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
Search our Forums:

Back to Top