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
 

 

Numerical formatting in French

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Indo-Canuck

New User


Joined: 22 Jun 2006
Posts: 3
Location: Canada

PostPosted: Sat Jul 17, 2010 12:12 am    Post subject: Numerical formatting in French
Reply with quote

I need to format numbers in French format. For example, the equivalent for 11,563.75 in French formatting would be 11 563,75

My question is are there any edited field definition for French, like we have ---,--9.99 for English.

I can do this by doing the following:

05 ED-AMT-1 PIC ---,---,---,--9.99.

MOVE Numeric-field TO ED-AMT-1
INSPECT ED-AMT-1 REPLACING ALL ',' BY ' '
INSPECT ED-AMT-1 REPLACING ALL '.' BY ','

For most part it works, but is there are a more elegant way of doing this ?

I also need to format numbers with the $ sign as well. In which case the French equivalent of $11,563.75 will be 11 563,75$. This where my INSPECT replace logic really falls apart.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8002
Location: Bellevue, IA

PostPosted: Sat Jul 17, 2010 12:28 am    Post subject:
Reply with quote

There is a link to manuals at the top of the page. Click on it, find the COBOL Language Reference manual, and check out section 4.1.8:
Quote:
4.1.8 DECIMAL-POINT IS COMMA clause

DECIMAL-POINT
IS COMMA Exchanges the functions of the period and the comma in PICTURE character-strings and in numeric literals.


The COBOL Programming Guide manual has section 1.3.10 on handling currency symbols, which might help.
Back to top
View user's profile Send private message
Indo-Canuck

New User


Joined: 22 Jun 2006
Posts: 3
Location: Canada

PostPosted: Sat Jul 17, 2010 12:50 am    Post subject:
Reply with quote

Thanks for taking the time...

I am sorry as I was not clear earlier. So I will give a little background of what I am trying to do. This program is for our statement process, so depending on the client's preference, I need to format the numbers in either English or French formatting. The program creates Compuset tags which will eventually have the statements printed...

The first and second input records to the program could be for English, but the third record probably will be for French... So it is just one program that has to do the formatting for both.

The DECIMAL-POINT IS COMMA clause is to be used in ENVIRONMENT DIVISION, so the change is going to be global, but that is not what I am looking for.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Jul 17, 2010 1:00 am    Post subject:
Reply with quote

most systems written for multi-locale,
do not have one big, huge, monster module to accomplish all the processing.

in your case, you could have several small modules,
that could be CALLed using a structure,
defined with a copybook, the fields of which would indicate
  • locale
  • function
  • input
  • output
  • etc

each of these small editing modules would essentially contain the same code,
except of course for the decimal is comma,
and of course, the appropriate currency symbol.

not rocket science; just modular programming.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Jul 17, 2010 1:21 am    Post subject:
Reply with quote

or you can use the LE CALLable service CEEFMON Formats monetary strings

then you can stay with you one big module.
Back to top
View user's profile Send private message
Indo-Canuck

New User


Joined: 22 Jun 2006
Posts: 3
Location: Canada

PostPosted: Sat Jul 17, 2010 1:50 am    Post subject:
Reply with quote

Believe me I am all for modular programming... But when you are dealing with a legacy system that has been around 20-25 years, modular programming sometimes just won't cut it, especially for the module that has been around since inception.

This program that creates the compuset tags for both English and French statements albeit with numeric formatting in English only, is now in version T05 (initially started at A00..A99, B00..), so it has gone through innumerable changes over the years. So I don't think, they are just going to say okay lets get a new process for French statements, just because the existing process needs to format numbers a little differently.

I especially do not want a new sub-program to do the number formatting for this program since as it is the program is running for upwards of 6 hours. There are about 200-300 distinct numbers I will need to format for French for just one account. So you can see how much of an overhead it will be if I am to process about 30,000 French accounts (we had about 100,000 statements total).

I am not trying to knock you down, rather I want you to understand some of the realities on my side. I do appreciate your inputs.
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: Sat Jul 17, 2010 2:05 am    Post subject:
Reply with quote

Hello,

Well, i've gotten lost. . . icon_confused.gif

How does using a subroutine versus in-line code have anything to do with "6 hours" or additional overhead? Wherever the French Formatting code is placed, it should take the same resources to do the work.

I suspect if the code is placed in the current "module", it will be PERFORMed. If placed in a soubroutine, it would be CALLed (which will/should have the same "cost" as a perform when executed).

The problem i see many places is certain of these huge old module implementations have become sacred. . . Especially the ones that are system critical and the same person has maintained them for "ever".

Good luck icon_smile.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8002
Location: Bellevue, IA

PostPosted: Sat Jul 17, 2010 3:36 am    Post subject:
Reply with quote

I'm confused AND lost with Dick. First you ask a problem and get a solution. And again, and again. Yet none of them are good enough for you.

First, why did you even post a question if you're not interested in the responses? And second, why don't you just implement whatever solution you're thinking of so we can move on to people willing to listen to our responses? Today is not psychic day and we are professional computer analysts, not mind readers. The quality and applicability of the solutions we provide can never be better than the quality and applicability of the data you provide about your 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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts Trasnmitting a file with french chara... spoorni IBM Tools 1 Wed Feb 24, 2016 8:13 pm
No new posts Formatting data from Excel to mainframe kishpra JCL & VSAM 5 Fri Feb 19, 2016 7:12 pm
No new posts Formatting date in DB2 manugeorge2004 DB2 4 Thu Dec 03, 2015 3:18 am
No new posts FTP of french characters in a txt fil... naresh54 IBM Tools 2 Thu Nov 12, 2015 8:12 am


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