Get CCSID and other attributes related to the current Job

Date:25 September 2006
Product/Release:LANSA for iSeries
Abstract:Retrieving CCSID and other Current Job Attributes
Submitted By:LANSA Technical Support

The following is an approach to retrieve your iSeries Job related attributes. This is recommended if you are not sure what attributes the job is running with.

In this case the CL program is designed to return the job CCSID, but could be extended to return other job information.

LANSA Function:

FUNCTION OPTIONS(*DIRECT)
DEFINE FIELD(#ATTRIB) TYPE(*CHAR) LENGTH(10)
DEFINE FIELD(#VALUE) TYPE(*DEC) LENGTH(5) DECIMALS(0)
CHANGE FIELD(#ATTRIB) TO(CCSID)
CALL PGM(RTVJOBA) PARM(#ATTRIB #VALUE) NUM_LEN(*DEFINED)
DISPLAY FIELDS((#VALUE))

CL PGM

/* Program Name: RTVJOBA */
/* Program Description: RETRIEVE JOB ATTRIBUTE */
/* Author Name: DOUG Date Written: 19/9/2006 */
/* Modification History: */
/* Date: Programmer Details of */
/* DD/MM/YY Initials Modifications */
/* */
/********************************************************************/
/* */
RTVJOBA: PGM PARM(&ATTRIB &VALUE)

/* Declarations: */
DCL VAR(&ATTRIB) TYPE(*CHAR) LEN(10);
DCL VAR(&VALUE) TYPE(*DEC) LEN(5 0)
/* Mainline: */
IF COND(&ATTRIB *EQ CCSID) THEN(RTVJOBA + CCSID(&VALUE))