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



Scott, thank you for the confirmation....

- Steve

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Tuesday, March 11, 2008 12:43 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: Reading Data Area

Sigh... RPG/400 is an extremely limited language. That's why IBM
hasn't developed feaures for it in 15 years. That's why just about
everyone frowns on it's use... it's an extremely limited language.

It does not support *LGL data areas. Here's a quote from the RPG/400
User's Guide:

"An RPG/400 program does not support data areas defined by the
CL command CRTDTAARA in which *LGL is specified as the TYPE
parameter."

So, truly, what you're planning is not possible with RPG/400 (at least,
not without calling an API). It's beyond the capabilities of RPG/400.
It might be worth noting, although this doesn't really help you, that
when you use a data structure as the result of an IN operation, the data

area MUST be *CHAR. However, if you used a numeric field (just the
field, not in a data structure) you could potentially read a *DEC data
area from RPG/400. But *LGL isn't possible.

ILE RPG/400, by contrast, has no problem with *LGL data areas:

d MyLglVar s 1N dtaara(TESTLGL)

c *lock in MyLglVar

Likewise, CL has no problem with them

RTVDTAARA DTAARA(TESTLGL) RTVVAR(&MYLGLVAR)

If you want to stay with the OPM environment, your best bet is to write
a CL program to retrieve the contents of your *LGL variable, and call
that CL program from your RPG/400.

Sorry.

Coyle, Stephen F. wrote:
Hi All...I'm having a problem trying to read a logical data area in
RPG400.

Data Area Definition:
Data area . . . . . . . : P57832LOCK
Library . . . . . . . : DVMODD
Type . . . . . . . . . : *LGL
Length . . . . . . . . : 1
Text . . . . . . . . . : Toggle Access to P57832 & P57833
Value . . . . . . . . . : 0

RPG code:
ILOCKDS DS 1
I 1 1 LOCK
I**CKDS DS
I** 1 1 LOCK
I**CKDS DS
I** 1 10LOCK
C *NAMVAR DEFN P57832LOCKLOCKDS
C IN LOCKDS
C LOCK IFEQ '1'
C** LOCK IFEQ 1

C MOVE DENY MSGTXT P
C CALL 'P57530'
C PARM 1 ENDOPT
C PARM MSGTXT
C MOVE *ON *INLR
C RETRN
C ENDIF

Error Message:
The P57833 193500 data area P57832LOCK type or length does not match
program data area (C G S D F).

I get this error whether the data structure is defined as character or
numeric. Can a *LGL type data area be read into an RPG400 program?
It worked fine in RPGIV but I was able to define the field to read
into
as an indicator.

Any help appreciated...Thanks in advance...

- Steve



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.