|
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;
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.
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.