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



Please note, autocorrect was driving me insane


So in a file there is a field defined as

EDROW INT NOT NULL GENERATED AWAYS AS IDENTIFY
(START WITH 1 INCREMENT BY 1 MINVALUE 1 NO MAXVALUE NO CYCLE NO CACHE ORDER),


Anyway… the SQLRPGLE program is straightforward
Define an data structure with external name keyword to that file
Declare a cursor with each field selected from that file to load in the data structure
Fetch it.

then try to %char it into a string and voila, MCH1210 Receiver to small.

You can move the field into a BINDEC(9:0) and use that with %trim but not the field itself.

So why cannot I get the %Char over the data structure field to work? Is that not allowed?

V7R3 TR10



Error File

Create of Replace Table ErrorFile(
EDROW INT NOT NULL GENERATED AWAYS AS IDENTIFY (START WITH 1 INCREMENT BY 1 MINVALUE 1 NO MAXVALUE NO CYCLE NO CACHE ORDER)
Error_Identification for column ERRID CHAR(8),
Error_Text for column ERRTXT CHAR(500),
Sequence_Number for column ERRCOL dec(10,0),
Primary Key Key(ERRCOL)
)
RcdFmt ErrRcv;


Example. (auto correct is killing me)

dcl-s error string char(500);
dcl-ds errorfile_ds extname(‘ERRORFILE’) Prefix(Err_) Qualified End-Ds;
dcl-s errbin bindec(9:0);
dcl-s myerr char(8);

errbin=errorfile_ds.err_edrow;

error = ’The Error was ‘ + %trim(%char(errbin));

error = ’The Error was ‘ + %trim(%char(errorfile_ds.err_edrow)); <- that will MCH1210


sql to load is similar to

exec sql declare cursor mycursor for
select edrow, erred,errtxt,errcol
from errorfile
where errid=:myerr;

exec sql fetch next from mycursor into :errorfile_ds;






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.