View previous topic :: View next topic
|
Author |
Message |
Ramanan-R
New User
Joined: 21 Mar 2007 Posts: 66 Location: Chennai, Tamilnadu, India
|
|
|
|
Hi ,
Please advise, how to convert 8 byte packed decimal field to unsigned packed decimal field using Syncsort...
Thanks! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Show some input data (in hex) and the output you want from this process. Packed-decimal includes a sign. . . |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
what do You mean by unsigned PD ...
show the HEX representation like for example
and guessing... You might want to transform it into
see Your previous post on dropping the decimal digits and use a bit of ingenuity ...
for example multiply by 10 into a 9 bytes field and use the first 8 bytes |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
enrico-sorichetti wrote: |
what do You mean by unsigned PD ...
show the HEX representation like for example
and guessing... You might want to transform it into
see Your previous post on dropping the decimal digits and use a bit of ingenuity ...
for example multiply by 10 into a 9 bytes field and use the first 8 bytes |
Or "unsigned" as in Cobol sense, with an F instead of the C/D? If nothing standard for that, a bit of ingenuity along enrico's lines, but maybe with a binary as well. Could be more tricky, as who knows which sign will be retained?
I guess a dive into your manual is required. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
well... for my interpretation here is a snippet
Code: |
the code snippet
000007 //S1 EXEC PGM=SORT
000008 //SYSPRINT DD SYSOUT=*
000009 //SYSOUT DD SYSOUT=*
000010 //SORTIN DD DISP=SHR,DSN=ENRICO.SORT.PS1
000011 //SORTOUT DD DISP=SHR,DSN=ENRICO.SORT.PS2
000012 //SYSIN DD *
000013 OPTION COPY
000014 INREC BUILD=(1,8,PD,MUL,+10,TO=PD,LENGTH=9)
000015 OUTREC BUILD=(1,8)
000016 //*
the data before
****** ***************************** Top of Data ******************************
****** 123456789012345678901234567890123456789012345678901234567890123456789012
000001 ׈i
000246800000000000000000000000000000000000000000000000000000000000000000
0013579C0000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000002 ׈i
000246800000000000000000000000000000000000000000000000000000000000000000
0003579C0000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000003 ׈i
000046800000000000000000000000000000000000000000000000000000000000000000
0003579C0000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000004 ׈i
000046800000000000000000000000000000000000000000000000000000000000000000
0000579C0000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000005 ài
000006800000000000000000000000000000000000000000000000000000000000000000
0000579C0000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000006 ài
000006800000000000000000000000000000000000000000000000000000000000000000
0000079C0000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000007 i
000000800000000000000000000000000000000000000000000000000000000000000000
0000079C0000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000008 i
000000800000000000000000000000000000000000000000000000000000000000000000
0000009C0000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000009
000000000000000000000000000000000000000000000000000000000000000000000000
0000009C0000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000010
000000000000000000000000000000000000000000000000000000000000000000000000
0000000C0000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
****** **************************** Bottom of Data ****************************
the data after
****** ***************************** Top of Data ******************************
****** 123456789012345678901234567890123456789012345678901234567890123456789012
000001 ,öé
000135790000000000000000000000000000000000000000000000000000000000000000
000246800000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000002 ,öé
000035790000000000000000000000000000000000000000000000000000000000000000
000246800000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000003 ,öé
000035790000000000000000000000000000000000000000000000000000000000000000
000046800000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000004 ,öé
000005790000000000000000000000000000000000000000000000000000000000000000
000046800000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000005 ,öé
000005790000000000000000000000000000000000000000000000000000000000000000
000006800000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000006 öé
000000790000000000000000000000000000000000000000000000000000000000000000
000006800000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000007 öé
000000790000000000000000000000000000000000000000000000000000000000000000
000000800000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000008 é
000000090000000000000000000000000000000000000000000000000000000000000000
000000800000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000009 é
000000090000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000010
000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
****** **************************** Bottom of Data **************************** |
if that is not what You asked for...
learn to ask question / describe the requirement in a better way |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
well... for my interpretation, with no snippet.
Define right-most byte(s) (one or two, experiment) as BInary. Add 3 to it, to change X'?C' to X'?F'.
That's it. |
|
Back to top |
|
|
|