Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
READ A PACKED "NEGATIVE" FIELD WITH EASYTRIEVE

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: READ A PACKED "NEGATIVE" FIELD WITH EASYTRIEVE
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: 8201
Location: Dubuque, Iowa, USA

PostPosted: Wed May 03, 2017 12:15 am    Post subject: Reply to: READ A PACKED "NEGATIVE" FIELD WITH EASYTRIEVE
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    Post subject:
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: 8201
Location: Dubuque, Iowa, USA

PostPosted: Wed May 03, 2017 1:02 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us