Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to convert 8 byte PD field to unsigned PD using Syncsort
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

Site Director


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

PostPosted: Mon Jul 11, 2011 9:57 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Mon Jul 11, 2011 9:59 pm    Post subject: Reply to: How to convert 8 byte PD field to unsigned PD usin
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7308

PostPosted: Mon Jul 11, 2011 10:12 pm    Post subject: Re: Reply to: How to convert 8 byte PD field to unsigned PD
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Mon Jul 11, 2011 10:31 pm    Post subject: Reply to: How to convert 8 byte PD field to unsigned PD usin
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7308

PostPosted: Tue Jul 12, 2011 12:23 am    Post subject: Reply to: How to convert 8 byte PD field to unsigned PD usin
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us