This example shows how to use mapped fields as join fields when dynamically joining database files without DDS.
OVRDBF FILE(JOINAB) TOFILE(FILEA) SHARE(*YES) OPNQRYF FILE(FILEA FILEB) FORMAT(JOINAB) + JFLD((YYMMDD FILEB/DATE)) + MAPFLD((YYMMDD 'YEAR *CAT MONTH *CAT DAY')) CALL PGM(PGME) /* Created using file JOINAB as input */ CLOF OPNID(FILEA) DLTOVR FILE(JOINAB)
The MAPFLD parameter defines the YYMMDD field as the concatenation of several fields from FILEA. You do not need to specify field attributes (for example, length or type) for the YYMMDD field on the MAPFLD parameter because the system calculates the attributes from the expression.