ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Printing BarCodes on ZEBRA Printer using RPG

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Re: Printing BarCodes on ZEBRA Printer using RPG

    Originally posted by Billw View Post
    I tried just that on one yesterday and it said Out of memory.

    Your best bet is call TLA support through:



    or at 1-800-541-4893
    Thanks, I think I will concede and call them for help.

    I will post my results on here for future Code400 reference.

    Comment


    • #17
      Re: Printing BarCodes on ZEBRA Printer using RPG

      This wont help you with the font issue but:

      not sure if I mentioned this but on the CD sent with new Zebra printers you get a free tool to desktop manage your zebra printers...

      It does make life a bit easier ... I have included the .exe here in a .zip file not sure if you need the full install to run please let me know.

      see image for tool view..
      Attached Files
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment


      • #18
        Re: Printing BarCodes on ZEBRA Printer using RPG

        Sweet, thanks Jamie!! You rock!!

        I just got off the phone with support.

        As it turns out, the font was indeed on the printer.

        For some strange reason, the AS/400 software wasn't putting in the codes in the spool file to use the Arial Narrow font!

        He had me call UTL24 and select Z140XI, and then there's some customization in there to tell it things about the printer. He had me set mine up like his and now it works great.

        I don't know how mine could have gotten messed up. The utility is not documented and nobody here would have gotten in and changed that stuff. Weird.

        Comment


        • #19
          Re: Printing BarCodes on ZEBRA Printer using RPG

          This looks like you guys have it all wrapped up and found a solution that works already but I wanted to also throw in here another possible solution that we use that is developed in JAVA.

          it includes a DDS, RPG (for record validation collection), CL to call the JAVA process and the JAVA process to print the label.

          it is actually pretty complex, but if you guys wanna see it, let me know and I'll post up some code samples.

          Comment


          • #20
            Re: Printing BarCodes on ZEBRA Printer using RPG

            Yes we do...Post away! please
            All my answers were extracted from the "Big Dummy's Guide to the As400"
            and I take no responsibility for any of them.

            www.code400.com

            Comment


            • #21
              Re: Printing BarCodes on ZEBRA Printer using RPG

              Now there are like 5 more java files that tie all this together that practically just are defining some of these classes referenced in here.

              This is the actual label definition Java Code I wrote.

              Code:
              package com.printer;
              
              import java.util.Enumeration;
              import java.util.NoSuchElementException;
              import java.util.Vector;
              
              import com.ibm.as400.access.AS400;
              import com.ibm.as400.access.PrintObject;
              import com.ibm.as400.access.PrintParameterList;
              import com.ibm.as400.access.QSYSObjectPathName;
              import com.ibm.as400.access.SCS3812Writer;
              import com.ibm.as400.access.SpooledFileOutputStream;
              
              class XlargeZebraLabel extends ZebraLabel 
              {
              
              
              	public XlargeZebraLabel() 
              	{
              		super( "E", 2 );
              	}
              	public static void main(String [] entryParms )
                  {
              
              	     
              	XlargeZebraLabel ll = new XlargeZebraLabel();    
              	
                  QSYSObjectPathName qpn = new QSYSObjectPathName( "QUSRSYS",
              		  		  					 	  entryParms[0], "OUTQ" );
                  
                  String Shipper = entryParms[1].trim();
                  String Order =  entryParms[2].trim();
              	String Line = entryParms[3].trim();
              	String Customer = entryParms[4].trim();
              	String CustomerNme = entryParms[5].trim();
                  String Item = entryParms[6].trim();
              	String Quantity = entryParms[7].trim();
                  String UnitOfMeasure = entryParms[8].trim();
                  String Copies = entryParms[9].trim();
                  String CurCopy = entryParms[10].trim();
              	String Rev = entryParms[11].trim();
                  String labelType = entryParms[12];
              
                 	    
              	try
                  {
                 	
              	  // set current font to D with a magnification factor of 3   
                 	  //AS400 system = new AS400( "localhost", "*current", "*current" );
                    AS400 system = new AS400(); // Use to Prompt
                 	  PrintParameterList parms = new PrintParameterList();
                    parms.setParameter( PrintObject.ATTR_OUTPUT_QUEUE, qpn.getPath() );
              	  SpooledFileOutputStream out;
              	  out = new SpooledFileOutputStream(system, parms, null, null);
                    SCS3812Writer scsWtr;
              	  scsWtr = new SCS3812Writer(out, 37, system);
                   	
                    // Label generation code starts here,
                    
                    // Set defaults, add start label, home position and copies line	
                    
                    ll.setLineSpacing( 15 );
                    ll.setHomePosition( 15, 10 );
                    ll.startLabel();
                    ll.addHomePositionLine(); 
              
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              
                   	ll.setFont( "E", 1 );
                     	String currentText = "Box " + CurCopy + " of " + Copies;
                   	ll.addTextLine( currentText );
              	  
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              
              	  ll.setFont( "E", 1 );
                    currentText = "(K) Purchase Order: ";	
                    ll.addTextLine( currentText );
              
               	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              
              	  ll.setFont( "E", 1 );
               	  ll.addTextLine( Order );
              	  	 
                 	  // Order Bar Code
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              
              	  ll.setFont( "E", 2 );
              	  ll.addBarCodeLine( "K" + Order );
              	  
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              
              	  // Rev .
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              
              	  ll.setFont( "E", 1 );
                    currentText = "(2P) Product Revision: ";
              	  ll.addTextLine( currentText );
              
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              	  
              	  ll.setFont( "E", 1 );
              	  ll.addTextLine( Rev );
              
                    // Rev Bar Code
              
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              
                    ll.setFont( "E", 2 );
                    ll.addBarCodeLine( "2P" + Rev );
              
              	  // Part label and number.
              
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              	  
              	  ll.setFont( "E", 1 );
              	  currentText = "(1P) Model No: ";	
              	  ll.addTextLine( currentText );
              
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              
              	  ll.setFont( "E", 1 );
               	  ll.addTextLine( Item );
              
                    // Item Bar Code
              
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              	  
              	  ll.setFont( "E", 2 );
              	  ll.addBarCodeLine( "1P" + Item );
              	  	
              
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              
              	  ll.setFont( "E", 1 );
              	  currentText = " (Q) Quantity/" + UnitOfMeasure + ": ";     	
              	  ll.addTextLine( currentText );
                   	
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              	  
              	  ll.setFont( "E", 1 );
                 	  ll.addTextLine( Quantity );
              
              		// Qty Bar Code
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              
              	  ll.setFont( "E", 2 );
              	  ll.addBarCodeLine( "Q" +  Quantity );
              
                       // Part label and number.
              
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              
              	  ll.setFont( "E", 1 );
              	  currentText = "Shipper Number:  ";	
              	  ll.addTextLine( currentText );
              
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              
              	  ll.setFont( "E", 1 );
               	  ll.addTextLine( Shipper );
              
                    // Item Bar Code
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              
                    ll.setFont( "E", 2 );
                    ll.addBarCodeLine( Shipper );
              	 	 
              	  ll.setCurrentXPosition( ll.getHomeXPosition() );
                    ll.setCurrentYPosition( ll.getCurrentYPosition() + 
              	  	                      ll.calculateFontTextHeight() );
              
              	  ll.setFont( "E", 1 );
              	  ll.addTextLine( CustomerNme );
              		  
              	  ll.addEndLine();
              	
              	  Vector lines = ll.getLabel();
              	      for ( Enumeration e = lines.elements(); e.hasMoreElements(); )
              	      {
              	        try
              	        {		
                          scsWtr.write( (String) e.nextElement() );
              		    	scsWtr.newLine();
              	        }
              	        catch ( NoSuchElementException nsee )
              	        {		
                	        }
              		  }
                  
              	scsWtr.close();
                  System.exit(0);
                  }
                  catch (Exception e)
                  {
                  	System.out.println("Exception Occurred; Message is: " + e.getMessage() );
                      System.exit(0);
                  }
                 }
              }
              Last edited by drmdub; June 27, 2008, 02:13 PM. Reason: Spelling errors... *shruggs*

              Comment


              • #22
                Re: Printing BarCodes on ZEBRA Printer using RPG

                Originally posted by kitvb1 View Post
                added the manuals I used at the time. I don't know if u have them (or have newer versions).
                I cannot open the manuals you have attached.. and also the zipped file..

                I am using LQ5400+(Wipro Make) and LX-800 (Epson Make) printers in my store. I have been using Mapics on AS400. To use Barcode, initially my factory used a software may be written in VB. This software is not linked to my AS400..

                Now, I want to write a program on Barcode in AS400 so that the inventory files in AS400 box gets updated. Can any one help me. I have read the topic on Printing BarCodes on ZEBRA Printer using RPG which is very helpful but I would like to do printing Barcode on Wipro and Epson Printer (Models mentioned above) using RPG and CL.. If possible on HP printers then also please let me know. Help me with some code..

                Thank you.
                Last edited by akitut; July 1, 2008, 01:28 AM.

                Comment


                • #23
                  Re: Printing BarCodes on ZEBRA Printer using RPG

                  Sorry... i missed this ... if you still need it, please reply.
                  (@jamie... I notice that since VB v3.7.0, if I just go to the main forum and then leave after 5 minutes without looking at anything, all posts are marked as read. Not only Code400 but iNetwork as well. Have you noticed anything?)
                  Regards

                  Kit
                  http://www.ecofitonline.com
                  DeskfIT - ChangefIT - XrefIT
                  ___________________________________
                  There are only 3 kinds of people -
                  Those that can count and those that can't.

                  Comment


                  • #24
                    Re: Printing BarCodes on ZEBRA Printer using RPG

                    Does anyone just happen to have
                    a) a guestimate of the price of TLA's product and
                    b) a copy of the demo disk?
                    Regards

                    Kit
                    http://www.ecofitonline.com
                    DeskfIT - ChangefIT - XrefIT
                    ___________________________________
                    There are only 3 kinds of people -
                    Those that can count and those that can't.

                    Comment


                    • #25
                      Re: Printing BarCodes on ZEBRA Printer using RPG

                      Kit, Private message sent to your inbox.
                      Bill
                      "A good friend will bail you out of jail,
                      A true friend would be sitting beside you saying,
                      'Wow, that was fun.'"

                      Comment


                      • #26
                        Re: Printing BarCodes on ZEBRA Printer using RPG

                        Thanks for the info Bill
                        Regards

                        Kit
                        http://www.ecofitonline.com
                        DeskfIT - ChangefIT - XrefIT
                        ___________________________________
                        There are only 3 kinds of people -
                        Those that can count and those that can't.

                        Comment


                        • #27
                          Re: Printing BarCodes on ZEBRA Printer using RPG

                          kit...sorry no I need to upgrade tonight.....also make sure your cookie settings include your domain.......Iseries uses default and it will cause issues.

                          jamie
                          All my answers were extracted from the "Big Dummy's Guide to the As400"
                          and I take no responsibility for any of them.

                          www.code400.com

                          Comment


                          • #28
                            Re: Printing BarCodes on ZEBRA Printer using RPG

                            Well here is an interesting problem on top of all this Zebra stuff. We bought a few large Zebra printers a couple years ago to print labels that have our product model's picture on it to stick it to the outside of the shipping boxes. Well it seems that the folks at Zebra only have Windows drivers for this, and it seems impossible to accomplish from our AS400. (we currently have a system that was developed by a third party running on windoze crapware that we want to move to the AS400.)

                            So I'm pretty sure that it is possible to do from the AS400 except for one minor hiccup

                            I need a way to get the .bmp image into its hex values and get those into a character string that we can print out to a spoolfile. Now the printing of the string to the spoolfile is no problem of course, but how the heck to you import the image from the ifs so that you can get it as a hex string?

                            Can I load the image to a dds file and then use a pointer to get that variable's address in memory and read until the end of the variable all the while stuffing it into a really big char variable?
                            Your future President
                            Bryce

                            ---------------------------------------------
                            http://www.bravobryce.com

                            Comment


                            • #29
                              Re: Printing BarCodes on ZEBRA Printer using RPG

                              Why use BMP when you can have XBM ? I'ts an old bitmap format and much easier to (de)code
                              and it gets even better, it's already readable in HEX !

                              Pre-history, just like a CSV But it works ! Check this OLD GEM out !

                              Google: XBM

                              Comment


                              • #30
                                Re: Printing BarCodes on ZEBRA Printer using RPG

                                I am so confuesd with the examples posted here. What I am trying to do is simple stupid. 1 line of 50 alphanumeric text next line of barcode39 and the next with the alphanumeric value of the Barcode. This is a legacy program with a printer files. I am in desperate need of help.


                                Code:
                                  5722WDS V5R4M0  060210                  SEU SOURCE LISTING                            01/05/10 10:03:40    SCHUMANN     PAGE    1
                                  SOURCE FILE . . . . . . .  SPLIBDEV/QRPGLESRC
                                  MEMBER  . . . . . . . . .  PAP140Z
                                  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0
                                    100      Hdebug(*yes)
                                    200       *---------------------------------------------------------------|
                                    300       *
                                    400       *     DESCRIPTION-- PI Roll Labels
                                    500       *
                                    600       *     AUTHOR------- Jeff Bandle                 DATE-- 10/12/04
                                    700       *        (based off of CGIPROG by Nancy/Demonte)
                                    800       *     MODIFIED BY--                             DATE--
                                    900       *
                                   1000       *---------------------------------------------------------------|
                                   1100       * NOTES:
                                   1200       * 1. Compile this source member as module PAP140 (PDM option 15)
                                   1300       * 2. Create program PAP140 from module PAP140 (PDM option 26)
                                   1400       *    with PROMPT(PF4) and BNDSRVPGM(QHTTPSVR/QZHBCGI)
                                   1500       *
                                   1600       *---------------------------------------------------------------|
                                   1700       * HTML Output file(prepared HTML output in SRC-PF output )
                                   1800      fhtmlout   if   e             disk    UsrOpn
                                   1900      f                                     rename(htmlout:rhtml)
                                   2000      fpaplot    if   e           k disk
                                   2100      fgrpmst    if   e           k disk
                                   2200      fpap140pf  o    e             printer UsrOpn                                                               10/14/05
                                   2300
                                   2400       *---------------------------------------------------------------|
                                   2500       * Include Protypes
                                   2600       *---------------------------------------------------------------|
                                   2700      d/Copy QRPGLESRC,CGIPR1
                                   2800       *---------------------------------------------------------------|
                                   2900       * DEFINE D-specs
                                   3000       *---------------------------------------------------------------|
                                   3100       * Variables for date flip
                                   3200      DTmpDat1          s               d   datfmt(*mdy)
                                   3300      DDateISO          s               d   datfmt(*ISO)
                                   3400      DDateUSA          s               d   datfmt(*USA)
                                   3500       * Variables for the CGI interface API QtmhGetEnv and QtmhRdStin
                                   3600      d InBuffer        s          32767a                                                                        05/12/08
                                   3700      d InBufLen        s             10i 0 inz(%size(InBuffer))
                                   3800      d InActLen        s             10i 0
                                   3900      d EnVarName       s             64A
                                   4000      d EnVarLen        s             10i 0
                                   4100       *
                                   4200       * Variables for the CGI interface API QtmhCvtDb
                                   4300      d DBBuff          s          32767a                                                                        05/12/08
                                   4400      d DBBuffLn        s             10i 0 inz(%size(DBBuff))
                                   4500      d DBDSLn          s             10i 0
                                   4600      d DBActLn         s             10i 0
                                   4700      d DBRespCd        s             10i 0
                                   4800       *
                                   4900       * Datastructure INPUT fields
                                   5000      d DBFileName      s             20a   inz('PAWLAB    *LIBL     ')
                                   5100       *
                                   5200       * Variables for the CGI interface API QtmhWrStout
                                   5300      d*OutBuff         s           8192a                                                                        05/15/08
                                  5722WDS V5R4M0  060210                  SEU SOURCE LISTING                            01/05/10 10:03:40    SCHUMANN     PAGE    2
                                  SOURCE FILE . . . . . . .  SPLIBDEV/QRPGLESRC
                                  MEMBER  . . . . . . . . .  PAP140Z
                                  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0
                                   5301      d OutBuff         s          32767a                                                                        05/15/08
                                   5400      d OutBuffLn       s             10i 0 inz(%size(OutBuff))
                                   5500       *
                                   5600       * Stand Alone Fields used as work fields
                                   5700      d Command         s            256
                                   5800      d Length          s             15p 5
                                   5900      d PostLenCh       s              5a
                                   6000      d PostLen         s              5s 0
                                   6100      d X               s              3s 0
                                   6200      d H               s              2s 0
                                   6300      d c               s              1s 0
                                   6400      d StartRow        s              1s 0
                                   6500      d ##rol           s             30
                                   6600      d ##fin           s             30
                                   6700      d ##brn           s             30
                                   6800      d tmpdta          s             15                                                                         07/28/05
                                   6900       *
                                   7000       * Define NewLine and break
                                   7100      dNewLine          c                   x'15'                                                                12/30/09
                                   7200      d Break           c                   '<BR>'
                                   7300       *
                                   7400       * Define HTML code sections
                                   7500       *
                                   7600      D#TitleOK         c                   '<TITLE>Update confirmed</TITLE>'
                                   7700      D#TitleErr        c                   '<TITLE>Invalid entries are present<-
                                   7800      D                                     /TITLE>'
                                   7900      D#BodyHeadOK      c                   '<h1>Update was successful.-
                                   8000      D                                     </h1>'
                                   8100      D#BodyHeadErr     c                   '<h1>Invalid entries are -
                                   8200      D                                     present.</h1><h2>Please correct-
                                   8300      D                                      the following error(s) and-
                                   8400      D                                      retry:</h2>'
                                   8500      D#Return01        c                   '<p><form><input type=button -
                                   8600      D                                     OnClick="location=''/cgi-bin/-
                                   8700      D                                     db2www/PaperInvMain.ndm/PORolls?'
                                   8800      D#Return02        c                   ' value="Return to Review PO">-
                                   8900      D                                     </form>'
                                   9000       *
                                   9100       * Define error text
                                   9200       *
                                   9300      D#CorrectErr      c                   '<p><form><input type=button -
                                   9400      D                                     OnClick="window.history.back();-
                                   9500      D                                     return false" value="Go back -
                                   9600      D                                     to correct errors"></form>'
                                   9700       *
                                   9800       * Internally described data structure. Used for Parsing
                                   9900       * Need a different one in each CGI-BIN you write
                                  10000      d pawlabDS      e ds                  ExtName(PAWLAB)
                                  10100      d selr                    7  15006    dim(500)
                                  10200      d selb                15007  15506    dim(500)
                                  10300       *
                                  10400       * Data structure for error reporting, from QSYSINC/QRPGLESRC(QUSEC)
                                  10500      d QUSEC           ds
                                  5722WDS V5R4M0  060210                  SEU SOURCE LISTING                            01/05/10 10:03:40    SCHUMANN     PAGE    3
                                  SOURCE FILE . . . . . . .  SPLIBDEV/QRPGLESRC
                                  MEMBER  . . . . . . . . .  PAP140Z
                                  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0
                                  10600      d  QUSBPRV                      10I 0 inz(16)
                                  10700      d  QUSBAVL                      10I 0
                                  10800      d  QUSEI                         7
                                  10900      d  QUSERVED                      1
                                  11000      d
                                  11100      D Wrk9            s              1    dim(9)
                                  11200      D lab             s              3  0 dim(500)
                                  11300      d
                                  11400      D@PARM            s             20A
                                  11500      D@VALUE           s            100A
                                  11600      DParmLen          s              3p 0
                                  11700      Dwk10a            s             10a
                                  11800      DValLen           s              3p 0
                                  11900      Dwk9a             s              9A
                                  12000      D LC              c                   'abcdefghijklmnopqrstuvwxyz'                                         07/28/05
                                  12100      D UC              c                   'ABCDEFGHIJKLMNOPQRSTUVWXYZ'                                         07/28/05
                                  12200       *---------------------------------------------------------------|
                                  12300       * DEFINE KEY LISTS
                                  12400       *---------------------------------------------------------------|
                                  12500       *---------------------------------------------------------------|
                                  12600       * BEGIN MAIN PROCESSING
                                  12700       *---------------------------------------------------------------|
                                  12800      C                   movel     *BLANKS       ErrorText       512
                                  12900
                                  13000      c     k#grpmst      klist
                                  13100      c                   kfld                    grcat
                                  13200      c                   kfld                    grcod
                                  13300
                                  13400
                                  13500       * Get the Environment Variable called REQUEST_METHOD
                                  13600       * Set the EnVarName to REQUEST_METHOD
                                  13700       * Set the EnVarLen to the length of this string
                                  13800       *
                                  13900      c                   eval      EnVarName = 'REQUEST_METHOD'
                                  14000      c                   eval      EnVarLen = %Len(%Trim(EnVarName))
                                  14100      c                   callp     APIEnVar(InBuffer:InBufLen:InActLen:
                                  14200      c                             EnVarName:EnVarLen:QUSEC)
                                  14300       *
                                  14400       * If used HTML method is GET
                                  14500      c                   If        %Subst(InBuffer:1:3) = 'GET'
                                  14600       *
                                  14700       * Get the Environment Variable called QUERY_STRING
                                  14800       * Set the EnVarName to QUERY_STRING
                                  14900       * Set the EnVarLen to the length of this string
                                  15000      c                   eval      EnVarName = 'QUERY_STRING'
                                  15100      c                   eval      EnVarLen = %Len(%Trim(EnVarName))
                                  15200      c                   callp     APIEnVar(InBuffer:InBufLen:InActLen:
                                  15300      c                             EnVarName:EnVarLen:QUSEC)
                                  15400      c                   else
                                  15500       *
                                  15600       * If used HTML method is POST
                                  15700       *
                                  15800       * Get the Environment Variable called CONTENT_LENGTH
                                  5722WDS V5R4M0  060210                  SEU SOURCE LISTING                            01/05/10 10:03:40    SCHUMANN     PAGE    4
                                  SOURCE FILE . . . . . . .  SPLIBDEV/QRPGLESRC
                                  MEMBER  . . . . . . . . .  PAP140Z
                                  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0
                                  15900       * Set the EnVarName to CONTENT_LENGTH
                                  16000       * Set the EnVarLen to the length of this string
                                  16100      c                   eval      EnVarName = 'CONTENT_LENGTH'
                                  16200      c                   eval      EnVarLen = %Len(%Trim(EnVarName))
                                  16300      c                   callp     APIEnVar(InBuffer:InBufLen:InActLen:
                                  16400      c                             EnVarName:EnVarLen:QUSEC)
                                  16500      c
                                  16600       *
                                  16700       * Convert recieved length from character into number
                                  16800      c                   eval      PostLenCh = *Zeros
                                  16900      c                   eval      %subst(PostLenCh:6-InActLen:InActLen)
                                  17000      c                             = %subst(InBuffer:1:InActLen)
                                  17100      c                   move      PostLenCh     PostLen
                                  17200       *
                                  17300       * Get the input parameters from STDIN using POST method
                                  17400      c                   z-add     PostLen       InBufLen
                                  17500      c                   callp     APIStdIn(InBuffer:InBufLen:InActLen
                                  17600      c                             :QUSEC)
                                  17700      c                   endif
                                  17800       *
                                  17900       * The rest of the program is the same for GET and POST
                                  18000       * Input data is in InBuffer with the length of returned data in InActLen
                                  18100       * Move this data to the QtmhCvtDb parms for parsing
                                  18200      c                   eval      DBDSLn = %size(PAWLABDS)
                                  18300      c                   eval      DBBuff = %subst(InBuffer:1:InActLen)
                                  18400      c                   eval      DBBuffLn = InActLen
                                  18500       *
                                  18600       * Parse using the QtnhCvtDb API
                                  18700      c                   callp     APICvtDB(DBFileName:DBBuff:DBBuffLn:
                                  18800      c                             PAWLABDS:DBDSLn:DBActLn:DBRespCd:QUSEC)
                                  18900       * Pass Userid and get Outq to override                                                                    10/14/05
                                  19000      C                   call      'PIRUSER'                                                                    10/14/05
                                  19100      C                   parm                    userid                                                         10/14/05
                                  19200      C                   parm                    Outq             10                                            10/14/05
                                  19300       *
                                  19400       * Override Outq and open file                                                                             10/14/05
                                  19500      c                   eval      Command = 'OVRPRTF FILE(pap140pf) ' +                                        10/14/05
                                  19600      c                             'OUTQ(' +%trim(Outq) + ') SECURE(*YES) '+                                    12/30/09
                                  19601      c                              'COPIES(6)'                                                                 12/30/09
                                  20300      c                   eval      Length = %Len(%Trim(Command))                                                10/14/05
                                  20400      c                   callp     ExecCommand(Command:Length)                                                  10/14/05
                                  20500      c                   open      pap140pf                                                                     10/14/05
                                  20600       * Write/Update database record file
                                  20700      C                   if        ErrorText = *BLANKS
                                  20800
                                  20900      C                   write     headof
                                  21000      c                   eval      x=0
                                  21100      c                   eval      h=0
                                  21200      c                   eval      c=0
                                  21300      c                   movea     '000000000000'*in(80)
                                  21400      c                   movea     '000000000000'*in(90)
                                  21500                                                                                                                 07/28/05
                                  21600       * check for starting row #
                                  5722WDS V5R4M0  060210                  SEU SOURCE LISTING                            01/05/10 10:03:40    SCHUMANN     PAGE    5
                                  SOURCE FILE . . . . . . .  SPLIBDEV/QRPGLESRC
                                  MEMBER  . . . . . . . . .  PAP140Z
                                  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0
                                  21700      c                   if        selsr <> '1' and selsr <> ' '
                                  21800      c                   move      selsr         StartRow
                                  21900      c                   eval      StartRow = StartRow - 1
                                  22000      c                   do        StartRow
                                  22100      c                   eval      h = h + 1
                                  22200      c                   write     detl01
                                  22300      c                   enddo
                                  22400      c                   endif
                                  22500                                                                                                                 07/28/05
                                  22501      c                   do        500                                                                          12/30/09
                                  22700      c     tag010        tag
                                  22800      c                   eval      x = x + 1
                                  22900      C                   if        selr(x) = *blanks
                                  23000      C                   leave
                                  23100      C                   endif
                                  23200      C                   move      selb(x)       test             30
                                  23300      c     selb(x)       cabne     'X'           tag010
                                  23400
                                  23500      C     sellot        chain     paplot
                                  23600      C                   eval      grcat = 'ROLLSIZE'
                                  23700      C                   eval      grcod = %trim(plrol)
                                  23800      C     k#grpmst      chain     grpmst
                                  23900      C                   eval      ##rol = %trim(grdsc)
                                  24000      C                   eval      grcat = 'BRAND'
                                  24100      C                   eval      grcod = %trim(plbrn)
                                  24200      C     k#grpmst      chain     grpmst
                                  24300      C                   eval      ##brn = %trim(grdsc)
                                  24400      C                   eval      grcat = 'FINISH'
                                  24500      C                   eval      grcod = %trim(plfin)
                                  24600      C     k#grpmst      chain     grpmst
                                  24700      C                   eval      ##fin = %trim(grdsc)
                                  24800      C                   eval      lab11 = 'Lot# ' + %trim(sellot) + ', ' +
                                  24900      C                                    %trim(plbas) + '#, #' + %trim(plgrd) +
                                  25000      C                                    ', ' + %trim(##rol) + ', ' +
                                  25100      C                                    %trim(##brn) + ', ' + %trim(##fin)
                                  28400
                                  28401      C                   eval      tmpdta = %xlate(LC:UC:%trim(selr(x)))                                        12/31/09
                                  28402      C                   eval      lab2110 = tmpdta                                                             12/31/09
                                  28403                                                                                                                 12/31/09
                                  28500      C                   eval      lab31 = %trim(selr(x))
                                  28501      C                                                                                                          12/31/09
                                  28502 XXXX C                   IF        LAB31 <> HLD31                                                               12/31/09
                                  28503 XXXX C                   MOVE      *ON           *INOF                                                          12/31/09
                                  28504 XXXX C                   ENDIF                                                                                  12/31/09
                                  28505 XXXX C                   MOVE      LAB31         HLD31            15                                            12/31/09
                                  28506      C                                                                                                          12/31/09
                                  28507      C                                                                                                          12/31/09
                                  28800
                                  28900      c   of              write     headof                                                                       07/28/05
                                  29000      c                   write     detl01                               of
                                  29100                                                                                                                 07/28/05
                                  29200      c                   enddo                                                                                  07/28/05
                                  29300                                                                                                                 07/28/05
                                  5722WDS V5R4M0  060210                  SEU SOURCE LISTING                            01/05/10 10:03:40    SCHUMANN     PAGE    6
                                  SOURCE FILE . . . . . . .  SPLIBDEV/QRPGLESRC
                                  MEMBER  . . . . . . . . .  PAP140Z
                                  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0
                                  29400      C                   endif                                                                                  07/28/05
                                  29500       *
                                  29600       * If you had multiple values for the same filed, you would have lost
                                  29700       * all but the one.  Cannot reliably predict which one you will get/   en
                                  29800       * You need another technique for this situation
                                  29900       *
                                  30000       * Override HTMLOUT to member BOLHTM and open file
                                  30100      C     BuildHTML     tag
                                  30200      c                   eval      Command = 'OVRDBf FILE(htmlout) ' +
                                  30300      c                             'MBR(BOLHTM) LVLCHK(*NO) '
                                  30400      c                   eval      Length = %Len(%Trim(Command))
                                  30500      c                   callp     ExecCommand(Command:Length)
                                  30600      c                   open      htmlout
                                  30700       *--------------------------------------------------------------------|
                                  30800       * Create the HTML Output in OutBuff field
                                  30900       * Write the HTML Required control records                             en
                                  31000       * ADD NewLine append after 80-120 characters to OutBuff
                                  31100       *--------------------------------------------------------------------|
                                  31200      c                   dou       %eof(htmlout)
                                  31300      c                   read      htmlout
                                  31400      C                   if        not(%eof(htmlout))
                                  31500
                                  31600      C                   select
                                  31700       ** Load Title
                                  31800      C     SrcDta        wheneq    '@@TITLE@@'
                                  31900      C                   if        ErrorText <> *BLANKS
                                  32000      C                   movel(p)  #TitleErr     TmpOutput       512
                                  32100      C                   else
                                  32200      C                   movel(p)  #TitleOK      TmpOutput
                                  32300      C                   endif
                                  32400       ** Load Body Heading
                                  32500      C     SrcDta        wheneq    '@@BODYHEAD@@'
                                  32600      C                   if        ErrorText <> *BLANKS
                                  32700      C                   movel(p)  #BodyHeadErr  TmpOutput
                                  32800      C                   else
                                  32900      C                   movel(p)  #BodyHeadOK   TmpOutput
                                  33000      C                   endif
                                  33100       ** Load Error descriptions
                                  33200      C     SrcDta        wheneq    '@@ERRORS@@'
                                  33300      C                   if        ErrorText <> *BLANKS
                                  33400      C                   movel(p)  ErrorText     TmpOutput
                                  33500      C                   cat       #CorrectErr:0 TmpOutput
                                  33600      C                   else
                                  33700       *               No errors - don't generate any HTML for this line
                                  33800      C                   iter
                                  33900      C                   endif
                                  34000       ** Generate "Return to PO Details" button - Always
                                  34100      C     SrcDta        wheneq    '@@DETAIL@@'
                                  34200
                                  34300      c                   eval      wk9a = %trim(selpo)
                                  34400
                                  34500      C                   eval      TmpOutput = #Return01 + 'PONum=' +
                                  34600      c                             %trim(wk9a) + '&Lot=' +
                                  5722WDS V5R4M0  060210                  SEU SOURCE LISTING                            01/05/10 10:03:40    SCHUMANN     PAGE    7
                                  SOURCE FILE . . . . . . .  SPLIBDEV/QRPGLESRC
                                  MEMBER  . . . . . . . . .  PAP140Z
                                  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0
                                  34700      c                             %trim(sellot) + '&UserID=' +
                                  34800      c                             %trim(userid) + '''"' + #Return02
                                  34900       ** If no replacement was needed then load SrcDta into TmpOutput as is
                                  35000      C                   other
                                  35100      C                   eval      TmpOutput = %trimr(SrcDta)
                                  35200      C                   endsl
                                  35300
                                  35400      c                   eval      OutBuff = %trimr(OutBuff) + %Trimr(TmpOutput)
                                  35500      c                             + NewLine
                                  35600      C                   endif
                                  35700      c                   enddo
                                  35800       *
                                  35900       * Send OutBuff to standard output
                                  36000       *
                                  36100      c                   eval      OutBuffLn = %len(%trimr(OutBuff))
                                  36200      c                   callp     APIStdOut(OutBuff:OutBuffLn:QUSEC)
                                  36300       *
                                  36400       * End Program
                                  36500      c                   close     htmlout
                                  36600       *
                                  36700      c                   eval      *InLr = *On
                                                                  * * * *  E N D  O F  S O U R C E  * * * *
                                Code:
                                  5722WDS V5R4M0  060210                  SEU SOURCE LISTING                            01/05/10 10:03:50    SCHUMANN     PAGE    1
                                  SOURCE FILE . . . . . . .  SPLIBDEV/QDDSSRC
                                  MEMBER  . . . . . . . . .  PAP140PFZ
                                  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0
                                    100      A********************************************************************
                                    200      A*                                                                *
                                    300      A*  PROGRAM:  PAP140PF - ROLL LABELS                              *                                        10/15/04
                                    400      A*   AUTHOR:  JEFF BANDLE (SPSI)                                  *                                        10/15/04
                                    500      A*     DATE:  10/15/04                                            *                                        10/15/04
                                    600      A*                                                                *
                                    700      A*  NOTE:  COMPILE PRINT FILE WITH THE FOLLOWING:
                                    800      A*         1) PAGE WIDTH OF 80
                                    801      A*         2) OUTQ LASERJET                                                                                08/17/05
                                    802      A*         3) DEVICE TYPE *AFPDS                                                                           08/17/05
                                    900      A*                                                                *
                                   1000      A*  MODIFICATIONS:                                                *
                                   1100      A*                                                                *
                                   1200      A*  DATE       PROGRAMMER    DESCRIPTION                          *
                                   1300      A*  --------   -----------   ------------------------------------ *
                                   1400      A******************************************************************
                                   1500      A          R HEADOF
                                   1600      A*                                     SKIPB(003)                                                          01/04/10
                                   1700      A          R DETL01                                                                                        10/15/04
                                   1800      A            LAB11         50         2FONT(2304 (*POINTSIZE 8))                                           08/17/05
                                   1900      A                                      SPACEB(002)                                                         10/19/04
                                   2200      A                                      SPACEA(001)                                                         10/19/04
                                   2300                                                                                                                 10/19/04
                                   2400      A            LAB2110       15         6BARCODE(CODE3OF9 1 *NOHRI -                                         01/05/10
                                   2500      A                                      (*WIDTH .010))                                                      10/19/04
                                   6200                                                                                                                 10/19/04
                                   6300      A            LAB31         15         8FONT(2304 (*POINTSIZE 14))                                          08/17/05
                                   6400      A                                      SPACEB(002)                                                         10/19/04
                                   6500      A                                      HIGHLIGHT                                                           10/19/04
                                   7000      A                                      SPACEA(001)                                                         10/19/04
                                                                  * * * *  E N D  O F  S O U R C E  * * * *
                                Last edited by jamief; January 5, 2010, 01:13 PM. Reason: formatting

                                Comment

                                Working...
                                X