Sponsored Links
Sponsored Link

sponsored links

Collapse

Announcement

Collapse
No announcement yet.

CPTFRMIMPF, STRPCO & STRPCCMD

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

  • CPTFRMIMPF, STRPCO & STRPCCMD

    Hi,
    Here I go again....
    After most of the morning reading one internet post after another regarding the commands in my subject line, I'm at a standstill.

    Objective:
    I've created a file via a CLP and a few calls to RPGLE programs and now want to have that file open on the user's PC in Excel.

    I've read that I would need to use the CPYFRMIMPF command to write to the IFS as a 'csv' file, then use STRPCO with option no, then STRPCCMD.
    So, I tried putting all this together and here I am.

    What is the real method and commands to use to get my objective done?
    I'm new to ILE and although I can understand Free, somewhat, the people in power don't want it used so this leaves me at RPGLE.

    Mike.
    Everyday's a school day, what grade are you in?

  • #2
    It sounds like you're on the right track. What seems to be the trouble? Is it giving an error? Is the CSV file created in the shared directory?

    Comment


    • #3
      jtaylor,
      OK, that's a start, being on the right track. So then, I do need all three commands.
      Can QTEMP be part of this adventure?
      On the CPYFRMIMPF command, I entered the "From File" information with the location of my file (in QTEMP) and for the "To data base file" information, used a file name (8,3) with a "CSV" extension in a system library. Left all the other parameters as is.
      When run; I get an error stating that the "To data base file" was not found. I do not see a parameter allowing creation of the file and no, it doesn't exist at this time.
      How do I create the file ?

      Everyday's a school day, what grade are you in?

      Comment


      • #4
        QTEMP should be fine. See what you can do with this.
        Code:
        CPYTOIMPF FROMFILE() TOSTMF() MBROPT(*REPLACE) STMFCODPAG(*PCASCII) RCDDLM(*CRLF) DTAFMT(*DLM)
        
        STRPCO
        MONMSG     MSGID(IWS4010)  
        
        STRPCCMD PCCMD('\\server\share\fileName.csv')

        Comment


        • #5
          Originally posted by jtaylor___ View Post
          QTEMP should be fine. See what you can do with this.
          Code:
          CPYTOIMPF FROMFILE() TOSTMF() MBROPT(*REPLACE) STMFCODPAG(*PCASCII) RCDDLM(*CRLF) DTAFMT(*DLM)
          
          STRPCO
          MONMSG MSGID(IWS4010)
          
          STRPCCMD PCCMD('\\server\share\fileName.csv')
          WOW, that got it all working except for the Excel part - file didn't open but there were 0 errors.
          Everyday's a school day, what grade are you in?

          Comment


          • #6
            jtaylor,
            I reran the program after changing the command to allow a pause and then I saw the issue. Part of the directory string (usr/) wasn't recognized so, I just need to figure out which directory to start from in the IFS..

            Thanks for all your help.

            Mike.
            Everyday's a school day, what grade are you in?

            Comment


            • #7
              FYI, STRPCCMD is client-side, so the command must be something the PC can handle/access. If it's Windows, that means wrong-way slashes. The file must also be accessible from the client (e.g. on a NetServer share).

              Comment

              sponsored links

              Collapse

              Working...
              X