Announcement

Announcement Module
Collapse
No announcement yet.

Play Time = Productive Time?

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Play Time = Productive Time?

    I wrote a system on the iseries that allows our QC operators to measure various physical dimensions for our parts. In fact every part has different dimension measuring requirements and acceptable limits, everything is control file driven. Once the test data is recorded, the data is stored in DB2, and we generate statistical reports such as histograms and control charts. The software that does the charting is a PC based tool that uses ODBC. The way we tell the PC tool what to chart is by generating a complex XML document. So cgidev2 was in fact a life saver that made generating the xml file much easier.

  • #2
    Play Time = Productive Time?

    The two URL's for the source (http://www.mcpressonline.com/ftp/prog/02/MCPRESSXML.zip & http://www.mcpressonline.com/ftp/prog/02/ProdTempl.zip) are not working.

    Comment


    • #3
      Play Time = Productive Time?

      My apologies. The links should work now. Victoria Mack, Executive Editor

      Comment


      • #4
        Play Time = Productive Time?

        Hi Jon, Should you wrap the XML character field data in an Encode2()? After all, I've been thinking about creating a product number in our system that is called '<>&". Thanks for the article. ) Chris

        Comment


        • #5
          Play Time = Productive Time?

          Greetings, Jon! After attending a few of your sessions at COMMON this Spring in Anaheim, I decided to use CGIDEV2 and Scott Klement's HTTPAPI in our shop's XML project. (Since we're still at V5R2, we're unable to utilize the XML-abilities of RPGIV available in V5R4.) We needed to build an XML file, put it into a SOAP wrapper and send it to the Medical Information Bureau (MIB)--then parse the response from the MIB and print the relevant data for our customer. CGIDEV2 helped tremendously! Our template contained the SOAP wrapper as well as the XML, and writing the file to the IFS was a piece of cake. HTTPAPI then aided the sending of the XML file via an HTTP POST, and the parsing of the response. It's a beautiful thing. Thanks so much for bringing it to our attention!

          Comment


          • #6
            Play Time = Productive Time?

            kgibson, I did something very similar. My problem was that some of the variables in the /COPY books from CGIDEV2 and LIBHTTP are named the same, so I got compiler errors. I had to break that logic up into separate programs. This was only a minor inconvenience, for the end result. Chris

            Comment


            • #7
              Play Time = Productive Time?

              Hi Chris, Yes - if you need to include characters that have specific meaning in XML in the data then it should be encoded. I debated whether to include this information in the article, but it can get complex quickly and I decided it was better to not confuse the issue at this point. I do intend to write a follow up a some point in the future which will cover this topic. If I have time later I'll dig out some references to threads in various forums that discuss this topic. Glad you liked the article.

              Comment


              • #8
                Play Time = Productive Time?

                Wow - that's terrific to hear. It really is a great approach - particularly if the "shape" of the XML document is likely to change in the future. You can often just get away with changing the template. Good to hear that Scott's terrific work came in handy for you as well. Thanks for writing.

                Comment


                • #9
                  Play Time = Productive Time?

                  Hi Chris, It is one of the limitations of the RPG /COPY that you have no option to change the names in a COPY member as you can in COBOL for example. I'm a bit surprised though since I know Scott uses naming conventions that are designed to avoid such collisions. What variables in particular were involved? If they relate to common structures such as USEC then you could probably avoid the problem by using conditional compilation directives to wrap those portions of the code so that they are not included if the other version is already present.

                  Comment


                  • #10
                    Play Time = Productive Time?

                    Jon, CGIDEV2/QRPGLESRC,PrototypeB and LIBHTTP/QRPGLESRC,IFSIO_H have lots of IFS root system type collisions. (O_RDONLY, O_WRONLY, O_RDWR, read, write, etc). I didn't see a way to avoid it using DEFINED. If you can suggest a way, that would be great. Thanks. Chris

                    Comment


                    • #11
                      Play Time = Productive Time?

                      OK - I should have guessed that they would both use those names! OK - here's how it works (I haven't got time to check this but you'll get the idea). Source - PrototypeB /DEFINE(PrototypeB) /IF NOT DEFINED(IFSIO_H) stuff that is in both /ENDIF Source - IFSIO_H /DEFINE(IFSIO_H) /IF NOT DEFINED(PrototypeB) stuff that is in both /ENDIF In other words each one sets a flag to say it has been included in the program. The other one uses that flag to determine if the duplicate lines should be included or not.

                      Comment


                      • #12
                        Play Time = Productive Time?

                        Jon, Another great job! I attended your session on CGIDEV2 last year in Naples and enjoyed it a great deal. Now that we have some breathing room I think we are ready to give it a try in earnest. Can't wait to hear about the enhancements to CGI that will further simplify it's use. Thanks again, Bill

                        Comment


                        • #13
                          Play Time = Productive Time?

                          Any ideas on the best way to set the column width for an Excel worksheet? I can use the to set the width, but how can I determine what the value of x should be?

                          Comment


                          • #14
                            Play Time = Productive Time?

                            Jon, Thanks for the suggestion. I am familiar with those compiler directives. Are you saying I should edit the installed /COPY books? My concern with that method is that I will need to revisit them when I install new versions of CGIDEV2 and LIBHTTP down the road (although CGIDEV2 is not likely to change, right?) because those updated /COPY's may have new variables added to them, some in common, some not. I just feel that putting those /COPY's in separate modules may require less maintenance in the future. Regards, Chris

                            Comment


                            • #15
                              Play Time = Productive Time?

                              you could use the %len BIF to determine the length such as: ColLgth = %len(%trim(column)) where collgth is the result of the length of the column field

                              Comment

                              Working...
                              X