Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

CPYF using *INCREL

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

  • CPYF using *INCREL

    Have you considered using the INCCHAR parm instead of the INCREL? This way you would specify the starting position in the file for the comparison string thus allowing you to use 6 positions instead of 9. I think that is itself is your problem.

  • #2
    CPYF using *INCREL

    Hi Ed! What are the attributes of the field in the file? I assume that it's character, length 9? Right now, I don't have a clue as to why it's not working like you (and I) think it should; just looking for more information. The default value for the TOMBR on the CPYF is *FIRST. Is the *FIRST member actually the member that you think it is? I've been bitten by that before.

    Comment


    • #3
      CPYF using *INCREL

      Trying to do a CPYF in a CLP (see code below) using a display field (FIELD1). The field has a value of "M12345". The file I am using for my CPYF contains 2 groups of records. 1 group contains the field with the above value, the 2nd group contains the field with the following: "M12345B". I want to copy records in which FIELD1 has the initial value M12345. When the CPYF executes it gives me M12345 and M12345B records. In debugger I see that &FIELD1 looks like 'M12345 ' and that in hex the trailing spaces are in fact blanks //404040//. Does anyone know how to get around this problem and why I am experiencing it? If I were asking for 'M12345' rather than 'M12345 ' I could understand the discrepancy. H E L P . . .
      Code

      Comment


      • #4
        CPYF using *INCREL

        The value in &field needs to be surrounded by quotes. You'll have to *cat it up or build an interim variable. See code below. First example returned value "X" and 'XA' Second example returned only 'X'
        Code

        Comment

        Working...
        X