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
 

 

Convert +9999999999999.99 to S9(12)V9(3)

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

New User


Joined: 12 Jan 2010
Posts: 22
Location: india

PostPosted: Thu Nov 17, 2016 8:15 pm    Post subject: Convert +9999999999999.99 to S9(12)V9(3)
Reply with quote

Hi,

I have a value like +9999999999999.99 which I want to convert to S9(12)V9(3).

After the conversion it should like 99999999999999{

Please advise how to achieve this using DFSORT.

Thanks,
Ramana.
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2164
Location: @my desk

PostPosted: Thu Nov 17, 2016 8:21 pm    Post subject:
Reply with quote

You have 13 9s before the decimal point in the example and you want to read it with 9(12)?. Anyways look here for examples on SFF format.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Thu Nov 17, 2016 9:43 pm    Post subject: Reply to: Convert +9999999999999.99 to S9(12)V9(3)
Reply with quote

If that is your data, you can just hard-code the PD value.

Since that is unlikely, what do other examples of that data look like? Is the position fixed? Length fixed? Sign fixed? Always two decimals? We can't tell much from one piece of example data.
Back to top
View user's profile Send private message
vnktrrd

New User


Joined: 12 Jan 2010
Posts: 22
Location: india

PostPosted: Thu Nov 17, 2016 10:17 pm    Post subject: Reply to: Convert +9999999999999.99 to S9(12)V9(3)
Reply with quote

Hi Bill,

Yes the data is fixed except for the sign which may be + or - . I have to retain the sign always.

I have tried with the below OUTREC but I am not getting the expected output.

Code:

OUTREC BUILD=(1,17,SFF,TO=ZD,LENGTH=15)


Input :
-0000037723069.39
Output :
00000377230693R

and when I move this value to S9(12)V9(3) it is being stored as 3772306.93 instead of 37723069.39.

Thanks,
Ramana.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Thu Nov 17, 2016 10:33 pm    Post subject: Reply to: Convert +9999999999999.99 to S9(12)V9(3)
Reply with quote

How do you define the field you MOVE to the S9(12)V9(3)? Your BUILD is working, bearing in mind that you don't have three decimal places in your data. I
Back to top
View user's profile Send private message
vnktrrd

New User


Joined: 12 Jan 2010
Posts: 22
Location: india

PostPosted: Thu Nov 17, 2016 10:34 pm    Post subject: Reply to: Convert +9999999999999.99 to S9(12)V9(3)
Reply with quote

with hex on it looks like below.


Code:

FFFFFFFFFFFFFFD
000003772306939
[/code]
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Thu Nov 17, 2016 10:41 pm    Post subject: Reply to: Convert +9999999999999.99 to S9(12)V9(3)
Reply with quote

We know. And it is correct.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2164
Location: @my desk

PostPosted: Thu Nov 17, 2016 11:38 pm    Post subject:
Reply with quote

If you have 3 decimal places in your target field, I suspect you might need to Multiply the value by 10 and then convert it to ZD.

Code:
 OUTREC BUILD=(1,17,SFF,MUL,+10,TO=ZD,LENGTH=15)

Code:
           ZD 1:15     
 <---+----1----+->     
     -37723069.390     


But can you answer Bill's question on the number of decimal places. If those are variable, there will be more to this, than just multiplying 10 for all records. It might be worth considering all possible input scenarios.
Back to top
View user's profile Send private message
vnktrrd

New User


Joined: 12 Jan 2010
Posts: 22
Location: india

PostPosted: Fri Nov 18, 2016 12:07 am    Post subject: Reply to: Convert +9999999999999.99 to S9(12)V9(3)
Reply with quote

The number of decimal places see always 2. Multiplying it with 10 will solve my problem.
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
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
No new posts help: convert C'00AB' to X'00AB' alan_gu DFSORT/ICETOOL 1 Thu Sep 29, 2016 12:22 pm
No new posts Convert Hex to readable format. harpreet_Saini19 DFSORT/ICETOOL 7 Wed Sep 14, 2016 5:46 am


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