From: Mark Johnson
> I'm not looking for a programming alternate or suggestions.
> Just a null conversion.
Then I think my suggestion of
CONV = '' or CONV = 'UDONOTHING'
will work, right?
> I didn't invent this situation. It's just one of the zillions
> of examples that I inherit with my client's systems. . . .
yeah, I know. I was just being cute and loveable.
It did strike me funny when I first read it.
> IF REC<5>="N" THEN CONV="MD2" ELSE CONV="D2/"
> PRINT OCONV(REC<6>,CONV)
So, modifying your example a bit, you could put a CASE construct before
the generic PRINT OCONV( REC<6>, CONV) to get something like:
DATA.TYPE = REC<5>
BEGIN CASE
CASE DATA.TYPE = 'N' ; CONV = 'MD2'
CASE DATA.TYPE = 'D' ; CONV = 'D2/'
CASE DATA.TYPE = 'T' ; CONV = 'MTS'
CASE DATA.TYPE = ... ; CONV = ...
CASE @TRUE ; CONV = '' ;* of no affect
END CASE
PRINT OCONV( REC<6>, CONV )
Or, if I'm wrong about CONV='', then
CASE @TRUE ; CONV = 'UDONOTHING' ;* of no affect
where you write and catalogue that user exit.
The basic manual, pg 11-484 for "OCONV(string, conversion)" says
"If conversion evaluates to the null value, the OCONV function
fails
and the program terminates with a run-time error message."
I don't believe it, but that's why I added the "user exit" suggestion.
Let us know what your final answer is.
> (P.S. I wonder how off-topic or deviated this thread will go.
> I'm just looking for a null conversion)
I'm going to take it to a "user exit" thread, myself.
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/