Page 1 of 1

M@SYSVAR

Posted: Sat Oct 28, 2023 5:49 am
by appbuilder
Does anyone know where the *AUTONUM value are stored. They are processed through the M@SYSVAR 3GL program, but I can't determine where the data is actually stored. I'd like to get at it from a stored procedure.

Re: M@SYSVAR

Posted: Sat Oct 28, 2023 8:26 pm
by René Houba
Hi appbuilder,

The autonums are special system variables. Data is coming from iSeries data areas or in Windows the internal LX_DTA table.

Programs that handle these are M@SYSDTA and M@SYSNUM (and not M@SYSVAR as you mentioned in the Subject name ;) ....)

Examples:

1.
*AUTONUMnnxxxxxxxxxx
where xxxxxxxxxx = your unique name

Gets & increments numeric value of length nn from (emulated) data area xxxxxxxxxx.
Can be used to hold last employee or customer number allocated.

2.
*AUTOALPnnxxxxxxxxxx
Gets & increments alphanumeric value of length nn from (emulated) data area xxxxxxxxxx.

3.
*DTAssslllxxxxxxxxxx
Gets data at position sss of length lll from (emulated) data area xxxxxxxxxx.

Kind regards,
René