Finding the value for papertray

I use WINPRINT-GET-PRINTER-MEDIA to search for the paper-trays. For how to do that, I used the source-lines in PRNDEMOX.cbl(version 9.1.1).

Here are the result out of 2 different printers.

HP CM4730; the values to WS-HB are 15, 257, 258, 259, 260, 261, 262, 1257,1258,1269,1270,1002,1272. This printer has 4 tray's.

HP2050; the values to WS-HB are 15, 262, 258, 259, 260, 261, 262. The standard model has 1 big tray and under it a second tray.

With value I have to move to WINPRINT-CURR-TRAY? The value 7 is WPRT-AUTO-TRAY.

Or do I have to use/make an other solutions.



  • I have on my office a Konica Minolta5430DL with 2 trays and a third is possible. The values I get in WS-HB are 1,3,7. The value 7 I do'nt count. So the result is 2 tray's, upper and lower. I send WPRT-UPPER-TRAY to

    WINPRINT-CURR-TRAY when the user has recorded by a particular program the value 1(tray). I send WPRT-LOWER-TRAY to WINPRINT-CURR-TRAY when the user has recorded by a other program the value 2(tray).

    How do I know how many tray's are really installed.

    Why give some printers the values like the KM5430DL and why others the values meantioned before?

  • Sorry, I made a mistake. Because the KM54530DL can have three tray's the value must be WPRT-MIDDLE-TRAY. With WPRT-LOWER-TRAY the printer give an error message on the printerscreen: TRAY3 NOT ATTACHED.

  • Not sure if this helps, there was another discussion like this here:

    You can use OpenPrinter (to get a handle), with the handle you can call DocumentProperties to get the DEVMODE for the printer. With this DEVMODE you can then call DeviceCapabilities for papernames (DC_PAPERNAMES).