×
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.
On 1/18/21 5:31 AM, techie21 IT wrote:
I have two fields let's say fld1,fld2(date field) and having their
data types in CL program as Character but in RPG program they are as
numeric
I suggested a DS, with zoned and character fields superimposed over each
other.
On 1/19/21 9:56 AM, techie21 IT wrote:
Sorry i did not understand it could you please explain it with a
code example in my program?
Well, I don't have all of your code to patch, but suppose the CL program
has:
DCL VAR(&FLD1) TYPE(*CHAR) LEN(6)
DCL VAR(&FLD2) TYPE(*CHAR) LEN(8)
with those fields passed to the RPG program, hopefully containing valid
character representations of numbers. Then the RPG program could have:
D FLD1 DS
D FLD1A 1 6A
D FLD1Z 1 6S 0
D FLD2 DS
D FLD2A 1 8A
D FLD2Z 1 8S 0
. . .
ENTRY PLIST
PARM FLD1
PARM FLD2
and you could then check FLD1A and FLD2A to make sure they're valid
zoned decimal numbers, and if so, you would reference FLD1Z and FLD2Z
for their numeric values.
Or, if I remember right, there are some slick (relatively) new built-in
functions that can, fed a character variable containing a valid,
parseable representation of a number, return the number (in which case
your validation would just be a go/no-go check, and you could skip the
old-fashioned DS overlays.
--
JHHL
As an Amazon Associate we earn from qualifying purchases.