Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 8117
Location: East Dubuque, Illinois, 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: 8117
Location: East Dubuque, Illinois, 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
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts RC 20 for Address ISPEXEC "ISRED... pkmurali CLIST & REXX 3 Sun Apr 16, 2017 11:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us