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 fixed-point data format to decimal

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

New User


Joined: 26 Jul 2013
Posts: 7
Location: Germany

PostPosted: Mon Mar 16, 2015 6:16 pm    Post subject: how to convert fixed-point data format to decimal
Reply with quote

I want to convert fixed-point data to decimal data.
I am using the following statements:

Code:
//SORT     EXEC PGM=SORT     
//SORTIN   DD *               
    MC  IZT7  H           MCTEST01     
0000DC44CEEF44C44444444444DCECEEFF40000
000A4300993700800000000000433523010000B
---------------------------------------
    MC  IZT7  H           MCTEST02     
0000DC44CEEF44C44444444444DCECEEFF40000
000A4300993700800000000000433523020000A
---------------------------------------
    MC  IZT7  H           MCTEST03     
0000DC44CEEF44C44444444444DCECEEFF40000
000A4300993700800000000000433523030000C
//SORTOUT  DD DSN=DCOLLECT.SMSDATA.MGMTCLAS,         
//            DISP=(,CATLG)                                 
//SYSOUT   DD SYSOUT=*                                       
//SYSIN    DD *                                             
  SORT     FIELDS=(27,8,CH,A)                               
  INREC    FINDREP=(IN=X'00',OUT=X'40')                     
  INCLUDE  COND=(05,02,CH,EQ,C'MC',AND,                     
                 27,06,CH,EQ,C'MCTEST')                     
  OUTFIL   CONVERT,                                         
  OUTREC=(01:C'./ ADD NAME=',27,8,80:X,/,                   
          01:C'MGMTCLAS(',27,8,C') +',80:X,/,               
          01:C'EXPNOUSE(',36,4,FI,C') +',80:X)   
//                                                       


This is the Result:
Code:
./ ADD NAME=MCTEST01     
MGMTCLAS(MCTEST01) +     
EXPNOUSE(1077952523 ) + 
./ ADD NAME=MCTEST02     
MGMTCLAS(MCTEST02) +     
EXPNOUSE(1077952522 ) + 
./ ADD NAME=MCTEST03     
MGMTCLAS(MCTEST03) +     
EXPNOUSE(1077952524 ) +


Which Statement can I use to get decimal data?
Thanks for your help.

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

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Mar 16, 2015 7:12 pm    Post subject: Reply to: how to convert fixed-point data format to decimal
Reply with quote

I'm not sure what you mean.

This, 36,4,FI, took a four-byte signed binary value and converted it it to zoned-decimal.

If that is not what you want, can you explain what you do want and give some "expected output" for your input data.
Back to top
View user's profile Send private message
Roland Brosio

New User


Joined: 26 Jul 2013
Posts: 7
Location: Germany

PostPosted: Mon Mar 16, 2015 7:29 pm    Post subject:
Reply with quote

hello Bill,
thank you for the answer.
I don't want a zoned-decimal result.

The result I expect is the following:

./ ADD NAME=MCTEST01
MGMTCLAS(MCTEST01) +
EXPNOUSE(0011) +
./ ADD NAME=MCTEST02
MGMTCLAS(MCTEST02) +
EXPNOUSE(0010) +
./ ADD NAME=MCTEST03
MGMTCLAS(MCTEST03) +
EXPNOUSE(0012) +

When I am using rexx with this function.
dmcexpdy = x2d(c2x(substr(dcoll.i,221,4)))
I get the expected result.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Mar 16, 2015 8:12 pm    Post subject: Reply to: how to convert fixed-point data format to decimal
Reply with quote

Yes, but in your Rexx you didn't change all the binary zeros to spaces first.

1077952523 is equal to X'4040400B'.

You used FINDREP to change all X'00' to X'40'. I don't know why you did that, but if you hadn't done it, you'd get the results matching your expected results except for the blank in front of the closing parenthesis. Try using BI (unsigned) instead of FI for that.
Back to top
View user's profile Send private message
Roland Brosio

New User


Joined: 26 Jul 2013
Posts: 7
Location: Germany

PostPosted: Mon Mar 16, 2015 8:47 pm    Post subject:
Reply with quote

hello Bill,
thank you,
that's it.
I changed the findrep to
INREC FINDREP=(INOUT(X'00',X'40'),STARTPOS=016,ENDPOS=026)
now I get a correct result:
EXPNOUSE( 11 ) +
EXPNOUSE( 10 ) +
EXPNOUSE( 12 ) +
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 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 ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 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