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:

but the result is :
BH02131 -m%

while I would like this:
BH02131 -m%

Thanks for your attention
Posts: 2
Joined: Mon Jun 20, 2011 2:58 pm

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
Posts: 931
Joined: Sat Oct 16, 2010 2:31 am
Location: Tottering-on-the-Brink

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.
Global moderator
Posts: 1672
Joined: Thu Jun 03, 2010 6:21 pm

Re: Conversion ZD to PD signed

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


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

Code: Select all
   OPTION COPY                     
   OUTREC FIELDS=(1,7,             

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: ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) -
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at
User avatar
Frank Yaeger
Global moderator
Posts: 1082
Joined: Sat Jun 09, 2007 8:44 pm

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.
Posts: 2
Joined: Mon Jun 20, 2011 2:58 pm

Return to JCL


  • Related topics
    Last post