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 can you convert PD to (ZD? or CH?)

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

New User


Joined: 27 Apr 2007
Posts: 7
Location: Philippines

PostPosted: Thu May 03, 2007 8:59 am    Post subject: How can you convert PD to (ZD? or CH?)
Reply with quote

Hi,

How can you convert 398388.53 as PD to 00000003983885C (ZD? or CH?) format?

Code:

//SYSIN    DD *                                             
    OPTION COPY                                             
    INCLUDE COND=(1,2,CH,EQ,C'64')                         
    OUTFIL NODETAIL,REMOVECC,                               
      TRAILER1=(5:MIN=(5,5,UFF,M11,LENGTH=5),                       
                20:COUNT=(M11,LENGTH=9),                   
----->        29:TOT=(54,5,PD,TO=ZD,LENGTH=15),           


398388.53 is the result of TOT which will have an output of '000000039838853' but I need to have it formatted to '00000003983885C'

Thanks in advance for your help! icon_biggrin.gif
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu May 03, 2007 9:17 pm    Post subject:
Reply with quote

You can just use DFSORT's ZDC format instead of ZD:

Code:

   29:TOT=(54,5,PD,TO=ZDC,LENGTH=15),


ZDC gives a C sign for positive values where ZD or ZDF gives an F sign for positive values.
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: Thu May 03, 2007 9:30 pm    Post subject:
Reply with quote

Hello,

I may be confused here, but how can a "real" decimal point be in a packed-decimal field
Quote:
How can you convert 398388.53 as PD
icon_confused.gif

If there is a '.' in the data, PD is not the correct type icon_question.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu May 03, 2007 10:02 pm    Post subject:
Reply with quote

Dick,

I assumed the decimal point is implicit (it's not stored internally but is known to be there) as it always is in a PD value. I think many people who work with COBOL (or other languages) aren't aware of how the data is actually stored internally - they just look at the COBOL external definition which includes the decimal point.
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: Fri May 04, 2007 2:15 am    Post subject:
Reply with quote

Hi Frank,

Yup, unfortunately
Quote:
I think many people who work with COBOL (or other languages) aren't aware of how the data is actually stored internally
this is all too true.

[sigh]Not understanding how their data is physically stored causes many of the newer folks much consternation and confusion. It also explains why trying to resolve something like an 0c7 is a more involved task than it would be if there was understanding of how data was stored.[/sigh]
Back to top
View user's profile Send private message
Mumblez

New User


Joined: 27 Apr 2007
Posts: 7
Location: Philippines

PostPosted: Fri May 04, 2007 1:04 pm    Post subject:
Reply with quote

Hi,

The '398388.53' stored as comp-3 is its value when the file is browsed through famvs with a display format of '000000039838853' (PD), that's what it meant.

Anyway, thank you guys very much, it worked!!!
Frank, you're awesome!!! icon_biggrin.gif icon_biggrin.gif icon_biggrin.gif
Back to top
View user's profile Send private message
Mumblez

New User


Joined: 27 Apr 2007
Posts: 7
Location: Philippines

PostPosted: Fri May 04, 2007 2:11 pm    Post subject: how to populate high values
Reply with quote

Hi,

follow up question.

how do i populate the rest of the trailer to high values?
right now, I am using multiple lines of X'FFFFFFFFFFFF...'
so my trailer would have an output fillers of dots as required.
is there any easier way?
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: Fri May 04, 2007 7:26 pm    Post subject:
Reply with quote

Hello D-D,

I'm surprised that this display
Quote:
famvs with a display format of '000000039838853' (PD)

doesn't include the sign icon_confused.gif

What would be displayed via famvs if the PD number was negative?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri May 04, 2007 8:54 pm    Post subject:
Reply with quote

Quote:
how do i populate the rest of the trailer to high values?
right now, I am using multiple lines of X'FFFFFFFFFFFF...'
so my trailer would have an output fillers of dots as required.
is there any easier way?


Yes, you can use nX'FF' where n is the number of X'FF' characters you need. n can be 1 to 4095 and you can use multiple nX'FF' characters if you need more than 4095 of them (e.g. 4095X'FF',4000X'FF').
Back to top
View user's profile Send private message
Mumblez

New User


Joined: 27 Apr 2007
Posts: 7
Location: Philippines

PostPosted: Mon May 07, 2007 11:28 am    Post subject:
Reply with quote

Thanks a lot. icon_biggrin.gif
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 Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
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