.st0{fill:#FFFFFF;}

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

 June 30, 2015

By  NickLitten

  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>

NickLitten


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

Nick Litten

related posts:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"cff50":{"name":"Main Accent","parent":-1},"a344d":{"name":"Accent Transparent","parent":"cff50"}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"cff50":{"val":"var(--tcb-skin-color-0)"},"a344d":{"val":"rgba(46, 138, 229, 0.85)","hsl_parent_dependency":{"h":210,"l":0.54,"s":0.78}}},"gradients":[]},"original":{"colors":{"cff50":{"val":"rgb(0, 178, 255)","hsl":{"h":198,"s":1,"l":0.5}},"a344d":{"val":"rgba(0, 178, 255, 0.85)","hsl_parent_dependency":{"h":198,"s":1,"l":0.5}}},"gradients":[]}}]}__CONFIG_colors_palette__

Get In Touch

Iā€™m always looking for awesome input, feedback and critique!

>