Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
vnktrrd

New User

Joined: 12 Jan 2010
Posts: 34
Location: New York

 Posted: Thu Nov 17, 2016 8:15 pm    Post subject: Convert +9999999999999.99 to S9(12)V9(3) 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.

Arun Raj

Moderator

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

 Posted: Thu Nov 17, 2016 8:21 pm    Post subject: 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.
Bill Woodger

DFSORT Moderator

Joined: 09 Mar 2011
Posts: 7314

 Posted: Thu Nov 17, 2016 9:43 pm    Post subject: Reply to: Convert +9999999999999.99 to S9(12)V9(3) 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.
vnktrrd

New User

Joined: 12 Jan 2010
Posts: 34
Location: New York

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

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.
Bill Woodger

DFSORT Moderator

Joined: 09 Mar 2011
Posts: 7314

 Posted: Thu Nov 17, 2016 10:33 pm    Post subject: Reply to: Convert +9999999999999.99 to S9(12)V9(3) 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
vnktrrd

New User

Joined: 12 Jan 2010
Posts: 34
Location: New York

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

with hex on it looks like below.

 Code: FFFFFFFFFFFFFFD 000003772306939
[/code]
Bill Woodger

DFSORT Moderator

Joined: 09 Mar 2011
Posts: 7314

 Posted: Thu Nov 17, 2016 10:41 pm    Post subject: Reply to: Convert +9999999999999.99 to S9(12)V9(3) We know. And it is correct.
Arun Raj

Moderator

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

Posted: Thu Nov 17, 2016 11:38 pm    Post subject:

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.
vnktrrd

New User

Joined: 12 Jan 2010
Posts: 34
Location: New York

 Posted: Fri Nov 18, 2016 12:07 am    Post subject: Reply to: Convert +9999999999999.99 to S9(12)V9(3) The number of decimal places see always 2. Multiplying it with 10 will solve my problem.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Convert VB file to FB plus special fo... cz016m SYNCSORT 15 Fri Oct 19, 2018 7:26 pm Convert a JOBGROUP into an OPC (TWS/I... Steve Coalbran JCL & VSAM 0 Tue Sep 18, 2018 12:06 pm Convert Julian to Gregorian zh_lad DFSORT/ICETOOL 21 Fri Jul 20, 2018 7:00 pm Convert JCL to Unix Shell scripts mistah kurtz All Other Mainframe Topics 2 Sun Jul 01, 2018 7:21 pm How to convert 2 bytes into single by... pkmurali DB2 6 Fri May 25, 2018 1:41 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us