Conversion ZD to PD signed



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Conversion ZD to PD signed

Postby pixel » Mon Jun 20, 2011 3:20 pm

Hi man!
Sorry for my english, i'am Fulvio, an italian boy.
My problem is the converion of a nombre signed from zoned to packed.
The input dataset is formed with matric and nombre:
( Ex. BH00001-00000160946)
BH00001 : MATRIC
-00000160946 : nombre -1609,46

I use this way:
OPTION COPY
OUTREC FIELDS=(1,7,
08,11,ZD,TO=PD,LENGTH=6)

but the result is :
BH02131 -m%
CCFFFFF444444000096
280213100000000164C

while I would like this:
BH02131 -m%
CCFFFFF444444000096
280213100000000164D

Thanks for your attention
pixel
 
Posts: 2
Joined: Mon Jun 20, 2011 2:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Conversion ZD to PD signed

Postby Akatsukami » Mon Jun 20, 2011 9:20 pm

Note that this is not a JCL question, but a *sort question, and ought therefore to have been posted in either the DFSORT or Syncsort forum, depending on which product your site uses.

That having been said, I think that you want to specify the input field as "LS" (zoned decimal with separate leading sign) rather than "ZD". It should be noted, though, that I am not a *sort maven; if another person corrects me, you should certainly use that correction.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Conversion ZD to PD signed

Postby steve-myers » Mon Jun 20, 2011 10:06 pm

The first problem you have is terminology. It helps us if you use the correct English words. The other issue is you do not fully understand the idea of a zoned decimal number: -00000160946 is not a valid zoned decimal number.

In a valid zoned decimal number the sign is in the high order 4 bits of the last digit. D (1101) is the most common indication of negative number. You have F (1111) which is an alternate indication of a positive number. The bit combinations in the high order 4 bits of the last byte are the same as the low order 4 bits of a packed decimal number. This confusing mess goes back to card sorting machines and the way they worked, and the way the EBCDIC character set was implemented so that cards could be read into the machine with intact signs. This link discusses the zoned decimal format.

The codes you show appear to indicate the - sign was not translated, or it was made 0 because it is invalid.

As Akatsukami says, this is not a JCL question; it should be raised in sort forums where conversions can be discussed in greater detail.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Conversion ZD to PD signed

Postby Frank Yaeger » Mon Jun 20, 2011 10:38 pm

Fulvio,

It appears you have an a 12-byte SFF numeric value in positions 8-19, so the correct DFSORT control statements would be:

   OPTION COPY                     
   OUTREC FIELDS=(1,7,             
     08,12,SFF,TO=PD,LENGTH=6)     


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Conversion ZD to PD signed

Postby pixel » Wed Jun 22, 2011 3:55 pm

Thanks for your answers, I will follow your advice.
Write the problem in the appropriate section.
pixel
 
Posts: 2
Joined: Mon Jun 20, 2011 2:58 pm
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post