|
The complexity came about in the answer that suggested the data area a.p.i.
Based on his most recent post, a file is really the best approach here, in
my opinion. He may only want to store the printer device name now, but what
about later? A file and a service program would make maintenance of this
simpler, I think.
Donald R. Fisher, III
Project Manager
Roomstore Furniture Company
(804) 784-7600 extension 2124
DFisher@xxxxxxxxxxxxx
<clip>
Isn't that extremely easy to do?
D SDS
D UserID 358 367A
D QCMDEXC PR ExtPgm('QCMDEXC')
D cmd 32702A const options(*varsize)
D len 15P 5 const
D cmd s 200A varying
D UserDtaAra s 21A
D Location ds dtaara(*Var:UserDtaAra)
D part1 1 2A
D part2 3 4A
D part3 5 10A
/free
// ------------------------------------------------
// Data areas are in the DTAARALIB library, and
// have the same name as the userid.
// ------------------------------------------------
UserDtaAra = 'DTAARALIB/' + UserID;
// ------------------------------------------------
// Does the data area exist? If not, create it.
// ------------------------------------------------
cmd = 'CHKOBJ OBJ(' + %trim(UserDtaAra) + ') OBJTYPE(*DTAARA)';
monitor;
QCMDEXC(cmd:%len(cmd));
on-error;
cmd = 'CRTDTAARA DTAARA(' +%trim(UserDtaAra) + ') ' +
'TYPE(*CHAR) LEN(10)';
QCMDEXC(cmd:%len(cmd));
endmon;
// ------------------------------------------------
// The IN op-code reads a data area:
// ------------------------------------------------
in *lock Location;
// ------------------------------------------------
// The OUT op-code updates a data area:
// ------------------------------------------------
Part1 = 'AA'; // these are just test values.
Part2 = 'BB';
Part3 = 'CCCCCC';
out Location;
*inlr = *on;
/end-free
Is there something else that I'm missing that would make this complicated?
<clip>
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.