IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to convert 8 byte PD field to unsigned PD using Syncsort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ramanan-R

New User


Joined: 21 Mar 2007
Posts: 66
Location: Chennai, Tamilnadu, India

PostPosted: Mon Jul 11, 2011 9:48 pm
Reply with quote

Hi icon_smile.gif,

Please advise, how to convert 8 byte packed decimal field to unsigned packed decimal field using Syncsort...

Thanks!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jul 11, 2011 9:57 pm
Reply with quote

Hello,

Show some input data (in hex) and the output you want from this process. Packed-decimal includes a sign. . .
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Jul 11, 2011 9:59 pm
Reply with quote

what do You mean by unsigned PD ...
show the HEX representation like for example


Code:
00013579
0002468C


and guessing... You might want to transform it into
Code:
00002468
00013579


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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jul 11, 2011 10:12 pm
Reply with quote

enrico-sorichetti wrote:
what do You mean by unsigned PD ...
show the HEX representation like for example


Code:
00013579
0002468C


and guessing... You might want to transform it into
Code:
00002468
00013579


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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Jul 11, 2011 10:31 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jul 12, 2011 12:23 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
Search our Forums:

Back to Top