ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Error CPYTOIMPF

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

  • Error CPYTOIMPF

    Hi,

    I have an error in a CLLE program with CPYTOIMPF command and I don't know how to fix it.

    Code:
    CPYTOIMPF FROMFILE(MY_FILE) TOSTMF(&VAR1) +
    STMFCCSID(*PCASCII) RCDDLM(*LF) +
    STRDLM(*NONE) STRESCCHR(*NONE) +
    RMVBLANK(*BOTH)
    .. but in debug mode I have this:

    Code:
    CPYTOIMPF FROMFILE(MY_FILE)
    TOSTMF(X ' 61C4E2D561404040404..40404')
    &the rest of command..

    I don't know why I have null character in my &VAR1, I tried with %TRIM before to CPYTOIMPF command and also in the body of the CPYTOIMPF command but no result..

    My &VAR1 is 100 length char, but I have only 10-20 char for this case.
    Thanks
    Last edited by gcraill; October 13, 2016, 09:13 PM. Reason: [ code ] tags

  • #2
    Is this in relation to your post "Limit of CLLE parameters?"
    If not, some more details of the issue and maybe all your code would help people understand the problem so they can assist.. As it stands, we don't know what error you are getting (you only say you are getting an error, which isn't very useful) and no details on how the variables are populated etc etc.

    Comment


    • #3
      John, yes, it is in relation with my another post
      I had a problem with the values of my parameters, but I don't know why,
      PHP Code:
      ]PGM
      PARM
      (&PNOM &PXML)
      DCL VAR(&PNOMTYPE(*CHARLEN(50)
      DCL VAR(&PXMLTYPE(*CHARLEN(50)
      DCL VAR(&VAR1TYPE(*CHARLEN(100)
      CHGVAR VAR(&VAR1VALUE('/home/VOICUCOSM/' + *TCAT &PXML *TCAT '.XML')
      CPYTOIMPF FROMFILE(FTESTTOSTMF(&VAR1) + STMFCODPAG(*PCASCIIRCDDLM(*LF) + STRDLM(*NONE
      I tried to make a manual call on the command ligne but it doesn't work, problem with the length of the parameters and how are there seen in the program .. but I just integrated this program in another SQLRPGLE program - my requirement was to create in IFS an XML file: step 1 - SQLRPGLE program to build a PF file - file with one filed 700 char - program 1 step 2 - call the program 2 - CLLE for transfer, after the building phase, from the program 1 -> with call from another program, all the things goes well and my file is copied in IFS.. yesterday I tried a manual call when I finished the CLLE for transfer and I saw these strange things with the values of parameters - details here http://www.code400.com/forum/forum/i...lle-parameters ... first time I ever met
      Last edited by jamief; October 16, 2016, 05:18 PM.

      Comment


      • #4
        Just for fun, make your parm CHAR lengths 32 and let us know if that works.
        Longer char parms over length 32 passed from the command line need explicit blanks at the end to pad out the value.

        Ringer

        Comment


        • #5
          Thanks for the extra information.
          This has been answered in good detail in your other thread. Just one of those command line call gotchas as Ringer has suggested above :-)

          Comment

          Working...
          X