Employing J/PCL in R/S 6000 and YDL

Architecture specific questions.

Employing J/PCL in R/S 6000 and YDL

Postby aguilarojo » 20 May 2009, 23:56

My experience working with very high end computer systems began after I left a career as a trade or business school instructor to work in a major hospital's data center using Stratus Computers which then ran on PowerPC CPUs. As I couldn't then afford a Stratus box (starting price: $500K+) I acquired instead one of the early Macs back when Apple was still producing PowerPC computers. In those days, Apple used an operating system which, although successful for art and graphics, was hardly acceptable for advanced computing when compared against Unix. Enter Terra Soft Solutions with it's first product Champion Server, which morphed into Yellow Dog Linux - I felt liberated to do serious work at home and at my office.

During the late 90's I was the junior member of a 4 person IT Department supporting a college. The college used Datatel's Colleague (http://www.datatel.com/) which ran above AIX on an R/S 6000. During that period, my home system was comprised of YDL which then ran on my old 233 MHz G3 Apple Beige Minitower. I had been assigned to work on a project which demanded utilizing R/S 6000 Job Control Language (JCL) and Hewlett-Packard's Printer Control Language (PCL) so that these systems would:

  • Recognize and talk to one another.

  • Execute custom designed programs so that these disparate systems would execute their respective duties in completing a task.

The J/PCL project lent itself to testing within YDL using the Beige Tower! As HP used PowerPC chips within their laser printers, common commands accessing the R/S 6000 CPU, were similar. YDL was an essential tool to have in completing this project as I would build the C program within YDL and then run/test it further on the R/S 6000. It was an enjoyable experience to run YDL on a PowerPC at my home as one tool the senior programmer could not crow about. He often emphasized the fact of being able to run and create .exe files from within AIX and then run them on his home PC, as well as vice versa. What is funny of course is that I probably could have removed from him that enjoyment by producing .exe files from within YDL and run them on AIX myself but I was focused on my task and knew, as he did, that even if I did - I couldn't run .exe files within YDL without using something like Wine which would have slowed my home system down terribly.

I cannot share the Datatel code I wrote/modified back then as Unibasic (the Datatel language which is essentialy Basic in Unix which controls all components of the Colleague database) was and remains proprietary. I can share the C code I wrote because the J/PCL of the machines I used are surely defunct by now. What I share as code here is merely useful as a suggestion of what could work on modern systems and is, I think, an interesting use of YDL which is perhaps not discussed often. The code follows:

Code: Select all

   /*  This program was originally created at MMC for counting lines of pages
       utilizing the desired font and other printing styles chosen for a particular
       department's use. 
       This program integrates RS/6000 JCL with HP-PCL utilizing C so that
       output ordered by a college department can be evaluated as to whether
       it is efficacious for daily implementation by said department
       utilizing official departmental forms, bills, etc. using these font
       and other printing styles.
      This particular program is limited by the fact that MAX is defines the
       lines of a page utilizing the invoked font style; the program itself is
       not aware of the end of the page.  The program is merely counting
       downwards from MAX. 
      This program is written such that it outputs to a file so that a hardcopy
      demonstrating the ordered font and printing styles can be examined by the department.
      After the department has made their decision and approved the printing styles
      and that form's appearance then the code implemented here in C, I further translated
      into Datatel's Unibasic to formally implement the chosen formats regularly into internal/external
      official college documentation for use by the Colleague DB for the college's daily business
      Name: linecounter3.c
      Programmer: Derick Centeno
      Date: 5.17.98
  #include <stdio.h>
  #include <string.h>
  #define   MAX   60
  main() {
          int counter; /*counts lines*/
                  FILE *out;
                  /* These variables defined as datatype "char" will hold different     
                   * types of data of a specific length which is why they hold     
                   * different values.  Another way of saying this is that the     
                   * character arrays are of different lengths in consideration   
                   * of the data they will contain.  The consideration of the extra     
                   * "null" char or "/0" following the end of each array was
                   * anticipated in constructing these arrays.  The HP printer will     
                   * send, via Printer Control Language (PCL), data of type char     
                   * into these arrays.     
                  char sym[7], space[8], pitch[9], hght[11], style[8], line[10],
                  lft_mrgn[8], stroke[9], type[9], reset[5], unit[10], p_source[10],
                  cmd_set[100], uel[12];
                  out = fopen("lns2.out", "w");
                  /* The array called "uel" MUST begin and end ALL PCL sequences. 
                   * It is the PCL exit command and following this format guarantees   
                   * that any previous open PCL commands will be exited before     
                   * the current PCL command list is encountered and the PCL
                   * list which does follow is properly concluded.  This format or
                   * procedure was recommended by the PCL language manual itself. 
                   * Structuring the PCL command sequences in this manner using C 
                   * allows for easy definition changes should the need arise in   
                   * the future.         

                  /* The Escape Key in ANSI C is: \33 
                   * Note how the Escape Key precedes each PCL code and how both   
                   * are ALWAYS between quotation marks.   
                  strcpy(uel, "\33%-12345X");
                  /*PCL command for resetting the printer.*/
                  strcpy(reset, "\33E");
                  /*PCL command for Left Margin at Column 0.*/
                  strcpy(lft_mrgn, "\33&a0L");
                  /*PCL for ASC II.*/
                  strcpy(sym, "\33(0U");
                  /*PCL for fixed spacing of characters.*/
                  strcpy(space, "\33(s0P");
                  /*PCL for pitch @ 12 char/inch.*/
                  strcpy(pitch, "\33(s12H");
                  /*PCL for font @ 10.5 points*/
                  strcpy(hght, "\33(s10.5V");
                  /*PCL command for upright font; ie. font intended to appear 
                   *right side up as opposed to upside down or sideways.   
                  strcpy(style, "\33(s0S");
                 /*PCL for font at medium thickness.*/
                 strcpy(stroke, "\33(s0B");
                /*PCL for lineprinter font family.*/
                 strcpy(type, "\33(s0T");
                 /*PCL for allowing printer equation: LF = CR + LF.*/
                strcpy(line, "\33&k2G");
                 /* PCL command representing the relationship:   
                  * 1 PCL unit = (1/96) inch.     
                 strcpy(unit, "\33&u96D");

                 /*PCL paper source command: sets use of manual tray.*/
                 strcpy(p_source, "\33&12H");
                 /*The following strcpy command initializes all the       
                  strcpy(cmd_set, sym);
                  strcat(cmd_set, space);
                  strcat(cmd_set, pitch);
                  strcat(cmd_set, hght);
                  strcat(cmd_set, style);
                  strcat(cmd_set, stroke);
                  strcat(cmd_set, type);
                  strcat(cmd_set, line);
                  strcat(cmd_set, unit);
                  strcat(cmd_set, lft_mrgn);
                  strcat(cmd_set, p_source);
                  fprintf(out, uel, reset);
                                          fprintf(out, "Line#: %d\n", MAX, reset, uel);
                  fprintf(out, "Page End#: %d\n", MAX, reset, uel);

As I said, figuring out the above was a great deal of fun. Also because of the incarnation of YDL available at the time, I was able to do serious and real work. The Mac OS at that time (8.6) was rather pitiful. YDL and AIX are for serious work in a complex world in need of complex solutions. AIX remains an outstanding operating system; YDL also is an outstanding operating system with the added advantage that it's availability as an open source system cannot be ignored for the researcher, professional or student who needs quality tools yet is strapped for cash.

Even if one has cash, YDL provides added value in allowing one to funnel available cash towards RAM, faster hard drives, better routers, or otherwise augment one's professional work. What I've shared here is a simple presentation of that reality.
User avatar
ydl guru
ydl guru
Posts: 227
Joined: 06 May 2009, 14:50
Location: New York City

Return to IBM

Who is online

Users browsing this forum: No registered users and 1 guest