Created On: 08 February 2011
Problem:
How can I use IDCAMS facilities from within a COBOL program ?
Resolution:
The MicroFocus emulation of IDCAMS (IBM's Access Method Services facility) is provided by the program MFJAMS, which can be invoked directly in a JCL step using either PGM=IDCAMS or PGM=MFJAMS.
When invoking the facility from within a COBOL program, you must use the name MFJAMS, and you must pass it a JCL-style parameter structure.
Parameter declaration:
01 AMSPARM.
03 PARMLEN PIC S9(4) COMP VALUE ZERO.
03 PARMTXT PIC X VALUE SPACE.
Call statement:
CALL 'MFJAMS' USING AMSPARM.
Program input:
MFJAMS will read it's input control statements from the DDname SYSIN, exactly the same as when invoked directly from JCL. These can be created by the calling program and written to SYSIN, which should then be closed before calling MFJAMS.
When invoking the facility from within a COBOL program, you must use the name MFJAMS, and you must pass it a JCL-style parameter structure.
Parameter declaration:
01 AMSPARM.
03 PARMLEN PIC S9(4) COMP VALUE ZERO.
03 PARMTXT PIC X VALUE SPACE.
Call statement:
CALL 'MFJAMS' USING AMSPARM.
Program input:
MFJAMS will read it's input control statements from the DDname SYSIN, exactly the same as when invoked directly from JCL. These can be created by the calling program and written to SYSIN, which should then be closed before calling MFJAMS.
Incident #2478369
Old KB# 33288
#EnterpriseDeveloper
#MFDS