Page 1 of 1

COBOL & Formdef

Posted: Tue Nov 26, 2019 7:27 am
by socker_dad
I'm new here, so if this is the wrong forum, please be nice!

I've been a mainframe programmer for 30 years and never have had the "joy" of working with forms in a COBOL program. Now I've been handed a rush job and have no idea how to do it. No - no one else in the agency knows how to do it either (at least, not that they're admitting).

The form (overlay?) is defined and accessible, but I don't know how to put the controls(?), whatever in the COBOL program to make the form work when it gets sent to the printer.

How do you do it?

Re: COBOL & Formdef

Posted: Wed Dec 04, 2019 10:07 am
by Anuj Dhawan
I've prepared the reply many times but one way or other ran into call of duty... this is off the bat.

FORMDEF and PAGEDEF are defined separately and used in JCL at run time. Usually IBM should provide you with a sample program to use the different parameters, that's a good place to start.

Re: COBOL & Formdef

Posted: Wed Dec 04, 2019 10:13 am
by Anuj Dhawan
PAGEDEF parameter used to identify a library member that contains statements to tell the Print Services Facility™ (PSF) how to print the sysout data set on a page-mode printer (such as the Infoprint 4000). The data set may be sysout or a data set that is allocated directly to a printer. The statements can specify the following:
  1. Logical page length and width.
  2. Fonts.
  3. Page segments.
  4. Multiple page types or formats.
  5. Lines within a page; for example:
  6. Line origin.
  7. Carriage controls.
  8. Spacing.
  9. Multiple logical pages on a physical page.
The member must be in the library named in the cataloged procedure that was used to initialize PSF, or in a library specified in the USERLIB parameter.

Further read:

Specifying a page definition: https://www.ibm.com/support/knowledgece ... expdef.htm

Specifying a form definition: https://www.ibm.com/support/knowledgece ... htm#exfdef

Page-printer defaults form: https://www.ibm.com/support/knowledgece ... .htm#dform

Re: COBOL & Formdef

Posted: Wed Dec 04, 2019 7:33 pm
by Robert Sample
Normally, COBOL programs rarely (if ever) get involved in FORMDEF / PAGEDEF matters -- that is JCL, not code (as pointed out elsewhere). In those rare cases when you do need characters sent from the program, most likely you'd define the string of characters in COBOL and write it to the DD statement as the first record. I've dealt with forms in the past, but we used CA-SPOOL which contained all the printer definition data in it (including HP's PCL strings).