ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Handling images on AS400

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

  • Handling images on AS400

    Hey guys, we are being asked if it is possible to handle images on the as400. We are an insurance company and want to store the pictures of the vehicles that our clients bring to get insurance. It is possible to do it in a green-screen environment, for example in a subfile? Or must we use websphere/hats/webfacing at all cost?

    For example we want to search a vehicle by its id and show its picture on the as400 to avoid the personnel looking for the physical file in a big cabinet. We have grown too big and are having problems organizing the data.

    My take is that a 5250 terminal cannot handle graphics, but i have seen some solutions that let you click on a "link" in the green screen program and it loads internet explorer. The IFS could be used to store the images on the as400 so i wouldn't have to store them on a separate server, but i want to know if someone has worked on this and can point me in the right direction.

    Thanks in advance.

  • #2
    Re: Handling images on AS400

    Storing them on the IFS and/or a network server will certainly work. If you are using iSeries Access for your 5250 emulation, you can choose to have the emulator recognize URL's and link directly to them.

    Another option is iSeries Access for Web, which runs the 5250 in a browser window, and you can do all sort of html stuff. However, I tried this and wasn't happy with the performance of the 5250 screens.

    Comment


    • #3
      Re: Handling images on AS400

      5250 can not handle graphics but the As/400 can send a PC command down so to open a graphics file stored on the IFS or PC server. The location/file name can be stored within a field in the green screen record, then when the user requests to "view" the PC type graphics image the green screen app sends the PC a command using strpccmd to open the file from the specified location.

      I do just that within a document management system tying vendor/customer/item docs (pdf,word, or any other type of PC doc) to the record. Then when the greeen screen requests to view it we send a PC command down to open it using the PC default viewer (adobe reader, word, image viewer, etc)

      Works great.
      Bill
      Bill
      "A good friend will bail you out of jail,
      A true friend would be sitting beside you saying,
      'Wow, that was fun.'"

      Comment


      • #4
        Re: Handling images on AS400

        Ok guys this seems like a good workaround, can you provide an example on how to do this or point me to a url or documentation? I tried googling for "handling url as400" but no luck

        I found something on STRPCCMD, i tried this:

        STRPCO PCTA(*NO)
        STRPCCMD PCCMD(NOTEPAD.EXE)

        and it runs.

        But how would i code an application to recognize that the user has clicked on a field that contains an url or something so the command can be launched'

        Comment


        • #5
          Re: Handling images on AS400

          When displaying the screen and user presses a function to display image or using a subfile selection value, then send the pc command down.

          The PC has default application hanlders, IE: If the user double clicks on a file with a PDF extension then the pc opens it with adobe. If I issue the following:

          Strpco
          strpccmd pccmd("c:\SomeDirectory\MyResume.doc")

          The pc will use the default applications to open MyResume.doc, if it exists in the given directory.

          Now assuming your are on a network what would happen if I issued:

          strpccmd pccmd("\\Yourserver\YourShare\MyResume.doc"). assumptions are that the windows user has the rights.

          Guess what it would open MyResume.doc from the given location.

          Try this one:
          strpccmd pccmd("\\YourAs400NetworknameorIP\AShare\Yourexpenses.xls")

          The PC would use the default application to open xls file.

          Code snippet:
          PHP Code:
           Strpccmd pccmd("\\ToDirectory\CurrentPicName"
          c                   Eval      File = %Trim(ToDirectory) + %Trim(CurPicNam)               
          c                   Eval      Comm StrPcCmd + %Trim(ToDirectory) +                     
          c                             %Trim(CurPicNam) + Txt6                                    
          c                   
          Eval      ComLgt = %Len(Comm)                                        
           *                                                                                       
          C                   CALL      'QCMDEXC'                                                  
          C                   PARM                    COMM                                         
          C                   PARM                    ComLgt 
          I have even added rundll parmameters to as to not show the dos box.
          Last edited by Billw; May 9, 2007, 11:22 AM.
          Bill
          "A good friend will bail you out of jail,
          A true friend would be sitting beside you saying,
          'Wow, that was fun.'"

          Comment


          • sheikhifti7
            sheikhifti7 commented
            Editing a comment
            Dear Bill please provide complete code it is very use full piece of code.

        • #6
          Re: Handling images on AS400

          You first use File and then use Txt6 in Comm. What's with that?
          And what does % mean? Seems like an ascii code or such...

          Comment


          • #7
            Re: Handling images on AS400

            "File" is a field name and so is "Comm". Value of Comm (aka command) when completely assembled will be like:

            'strpccmd pccmd(\\Server\Directory\SelectedPictureName.xxx)'

            "Todirectory" is a variable which contains the server and share to search for the file.
            CurPicNam is the variable which contains the file name associated with the selected record.

            Txt6 is a constant "')" (single quote and right bracket)

            the %Trim is RPGLE built in function.
            Bill
            "A good friend will bail you out of jail,
            A true friend would be sitting beside you saying,
            'Wow, that was fun.'"

            Comment


            • #8
              Re: Handling images on AS400

              To see how to connect via URL from 5250, try this

              GO MAIN (IBM main menu)
              11. Information Assistant
              1. Where to look for info
              Click on the IBM URL - it takes you right to the web site

              If it doesn't work, you need to enable URL. In the emulator, click Edit / Preferences / Hotspots / Execute URL

              This works with iSeries Access.

              Comment


              • #9
                Re: Handling images on AS400

                Hi,

                I tried it & Its working !
                It's fun to learn new things .
                Thanx Billw .

                Deepa
                Last edited by Deepa; May 10, 2007, 01:38 AM.

                Comment


                • #10
                  Re: Handling images on AS400

                  Ya I was tickled when I started to experiment with that too. I cool to see real interaction from green screen to PC.

                  Now it opens other possibilites up. How about real scorn error messages. Enter something wrong, invalid part, pop-up a video or sound bit giving them hell for doing it wrong. How about a verbal warning....or their boss's face reaming them out....LOL. Moon them...
                  Bill
                  "A good friend will bail you out of jail,
                  A true friend would be sitting beside you saying,
                  'Wow, that was fun.'"

                  Comment

                  Working...
                  X