Page 1 of 1

Convert Signed Zoned Decimal to Packed Decimal

PostPosted: Fri Aug 26, 2016 3:54 pm
by vnktrrd
Hi,

I have a problem of similar kind to this http://www.ibmmainframeforum.com/syncsort-synctool/topic9521.html. Please advise.

I have a ZD input like -9(11).9(2) and I want to conver it to PD.

When I use the below SORT card
SORT FIELDS=(501,10,CH,A)                            
SUM FIELDS=NONE                                      
OUTREC FIELDS=(1:501,10,11:511,6,17:C'XXXXXX',      
               80,15,ZD,PD,LENGTH=8,31:132,10,41:40X)

I got this output
000000B0
0000530C
--------
000004B0
0000115C
--------
000001B2
0000003C
--------
000001B2
0000012C
.

Not sure why there is a B for every hexadecimal. I am worried because when I open this in STARTOOl, I cannot see any value but '?'
Coded

Re: Convert Signed Zoned Decimal to Packed Decimal

PostPosted: Fri Aug 26, 2016 4:40 pm
by NicC
Do not tail-gate old topics. Your post has been split and cross-referenced.
Also, use the code tags to present stuff on your screen.

You have not shown us any input. How can we determine the cause if we cannot see what you are converting?

Re: Convert Signed Zoned Decimal to Packed Decimal

PostPosted: Fri Aug 26, 2016 4:47 pm
by vnktrrd
Here are the input values.

 0000000004.50
 00000000010.32
 00000000054.44
 00000000141.50
 00000000105.78
 00000000011.22
 00000000027.76
 00000000007.21
 00000000179.81
 00000000008.76
 00000000339.70
 00000000048.35
 00000000503.00
 00000000011.48
 

Re: Convert Signed Zoned Decimal to Packed Decimal

PostPosted: Fri Aug 26, 2016 4:55 pm
by vnktrrd
I think I am not clear in the above question. Here I reframe it again.

I have above values in the input file and they are of format -9(11).9(2). I want to convert them to PD(S9(11)V9(2)) using sort and write to another file.
When I use below sort card it is not giving me expected results. 80,15,ZD,PD,LENGTH=8 is to do this conversion.


SORT FIELDS=(501,10,CH,A)                            
SUM FIELDS=NONE                                      
OUTREC FIELDS=(1:501,10,11:511,6,17:C'XXXXXX',        
               80,15,ZD,PD,LENGTH=8,31:132,10,41:40X)
 

Re: Convert Signed Zoned Decimal to Packed Decimal

PostPosted: Fri Aug 26, 2016 7:26 pm
by vnktrrd
I have solved the prob.
I have used INREC to edit and then converted from ZD to PD.


INREC FIELDS=(1:1,79,80:80,15,UFF,EDIT=(IIIIIIIIIIIIIIT),
               95:95,905)