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 Packed Decimal to Display/char

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sandybadam

New User


Joined: 09 Oct 2006
Posts: 14

PostPosted: Thu Feb 07, 2013 1:00 pm    Post subject: How to convert Packed Decimal to Display/char
Reply with quote

Hi,

I have a input file consists of Hexa Decimal(may have negative value) feilds and I want to convert it to display/char format.
both A and B are in Hexa decimal format.
Code:
A = 00033333
      0033333C


Code:
B = 00022222
      0022222D


I tried to do by using the below code.
Code:

OUTREC FIELDS=(64,8,PD,TO=ZD,X,
               72,8,PD,TO=ZD,X)

Below is the ourput i got

Code:
A = 000003333333333
B = 00000222222222K


I am geeting K as a sign bit but i want it to be displayed as -2222222222 and also I dont want to display the trailing zeros.

Code'd and title clarified
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Thu Feb 07, 2013 1:19 pm    Post subject: Reply to: How to convert Packed Decimal to Display/char
Reply with quote

Look up EDIT in the manual.

What "trailing zeros"? You mean "leading zeros"? EDIT can do it all, and more.
Back to top
View user's profile Send private message
sandybadam

New User


Joined: 09 Oct 2006
Posts: 14

PostPosted: Thu Feb 07, 2013 4:07 pm    Post subject: How to convert HexaDecimal to Display/char format using Sort
Reply with quote

Thanks Bill Woodger. It worked.

But now I have another question.

I want to merge 2 files using the same sort step.

File1 is a Header file
File2 is a record file

There is no need of formatting the header file,
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Thu Feb 07, 2013 4:29 pm    Post subject: Reply to: How to convert Packed Decimal to Display/char
Reply with quote

We have no way of knowing.

Please start a new topic with the request, showing representative input data for both files and expected output, RECFM and LRECL of all files. Use the Code tags, please, to preserve spacing of data.
Back to top
View user's profile Send private message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Thu Feb 07, 2013 6:19 pm    Post subject: Re: How to convert HexaDecimal to Display/char format using
Reply with quote

sandybadam wrote:
Thanks Bill Woodger. It worked.

Can you show us the code "that worked"?
It may help the next person will the same/similar question.
Thanks.
Back to top
View user's profile Send private message
sandybadam

New User


Joined: 09 Oct 2006
Posts: 14

PostPosted: Thu Feb 07, 2013 6:28 pm    Post subject:
Reply with quote

Code:



OUTREC FIELDS=(64,8,PD,EDIT=(SIIIIIIIIIIIIIII),SIGNS=(,-),X,         
               72,8,PD,EDIT=(SIIIIIIIIIIIIIII),SIGNS=(,-),X)         
                   
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Display ZEDLMSG without Pressing F1 &... anandgbe CLIST & REXX 8 Thu Dec 15, 2016 4:20 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am


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