× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I wholeheartedly agree with you Jon. I showed him how to create his own
function to do it (in RPG) via the link here
http://faq.midrange.com/data/cache/185.html

And you suggested he could create his own function in Cobol. However,
he's reading between the lines that we are saying something else.

So, if he wants to do something like
Select Salary, Formatted(Salary)
from payrate
where EmployeeNumber = :wEmployeeNumber;
He can build his own "Formatted" function that could take a number and
format it to his fondest wishes. Upon doing so he could then imbed the
above select statement into any program (RPG, COBOL, etc) that his little
heart desires.

The basic concept is that you use a CREATE FUNCTION like this
create function QGPL/FORMATTED (DEC (11,2))
returns CHAR(15)
language rpgle (or cobol or ...)
deterministic
no sql
returns null on null input
no external action allow parallel
simple call
external name 'LIBRARY/PROGRAM(SUBPROCEDURE or whatever a subprocedure
is called in Cobol)'

This function would allow you to pass in a 11.2 number (gosh, I can't even
remember how to 'PIC' that). The function would then format it as
xxx,xxx,xxx.xx-
That's why the CHAR(15).

Quite Easily Done.

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.