June 30

0 comments

Adding bar codes to good old fashioned spool reports | AS400 RPG BARCODE OVERLAY

By NickLitten

June 30, 2015

barcode, dds, prtf

  1. Have you been asked to add a part number as a barcode to an existing warehouse report?
  2. Does the report currently print as an old fashioned text based spool that looks like it came from the 1980’s?
  3. Is this program written in RPG?
  4. Is the Printer file defined in DDS?

If the answer to these questions is YES — then this is how you do it!

I know this is common knowledge, but there are still lots of freshers out there in the burgeoning world of IBM i development and this is just a simple way of doing it that I happened to use this week. I also had to explain the process to a senior management team player (who had roots in programming) and thought it would have been nice to simply say “go and read my blog it will explain”… so… erm… here is a blog about it (better late than never).

Lets imagine a simple PRTF that already prints a part number (in this case PNUM35).

Run the report and in plain text format (known as *SCS) it might look something like this:

*...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 AHP RECEIVING FORM - RECEIVING Form QGMP-003 --------------------------------------------- Rev. 09/2012 RECEIVING AHP LOT#: 133805 --------- ITEM NUMBER............: 5500401/0913 GRN.: 0064801 PRODUCT NAME...........: CARTON SMALL TF HUD PURCHASE ORDER.........: 039358 LINE: 001 DISTRIBUTED BY.........: ROCK-TENN FINANCIAL INC. MANUFACTURE EXPIRE DATE: 6/26/17 PACK BY DATE: 6/26/17 MANUFACTURE LOT#.......: NickTest RECEIVING DATE./.BY....: 6/26/15 AURUSRTST2 QUANTITY...............: 112,200.000 Pallets SKID COUNT.............: 1 -------------------------------------------------------------- | QTY DISTRIBUTED | INITIALS | DATE | AHP LOT# | -------------------------------------------------------------- | | | | | -------------------------------------------------------------- | | | | | -------------------------------------------------------------- | | | | | -------------------------------------------------------------- | | | | | -------------------------------------------------------------- | | | | | -------------------------------------------------------------- | | | | | -------------------------------------------------------------- | | | | | -------------------------------------------------------------- ------------------------------- | APPROVED FOR REPACKAGING | ------------------------------- | | | | | | | Q U A R A N T I N E | | | | | | | | | | | -------------------------------

Now we just have to add the barecode value to that whitespace at the bottom of printed layout. The DDS for this might look like:

* <NJL01>
* BARCODE(BAR-CODE-ID [HEIGHT] [[*HRZ | *VRT]
* [*HRI | *HRITOP | *NOHRI] [*AST | *NOAST]
* [MODIFIER] [UNIT-WIDTH]
* [WIDE/NARROW-RATIO]])
A PNUM35BC 15A 60BARCODE(CODE128 2)
* </NJL01>
{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Join the IBM i Community for FREE Presentations, Lessons, Hints and Tips

>