× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: CPYF using Variables in CLP
  • From: dbryant@xxxxxxxxxxxx
  • Date: Mon, 22 Jan 2001 09:52:55 -0500



I finally got through to the IBM websites and I found some information on using
variables with the INCREL parameter of the CPYF command.

It states to enter the character value without the 2-byte length field. The
length of the data that is entered determines the number of bytes that are used
for the comparison. If the actual data in the variable-length from-field is
shorter that the value specified for the INCREL parameter, the from-field data
is padded with single-byte blanks (X'40) for the comparison.

BTW,    PRDNO is a 15 character field.   And we are on V4R4.

So I left off the field length in the DCL ....

DCL        VAR(&FPRDN) TYPE(*CHAR)


 CPYF       FROMFILE(&LIBRARY/&FILE) +
              TOFILE(QTEMP/BMHSP100X) FROMMBR(&FMEMBER) +
              TOMBR(&TMEMBER) MBROPT(*ADD) +
              CRTFILE(*YES) INCREL((*IF PRDNO *EQ +
              &FPRDN)) FMTOPT(*MAP *DROP) ERRLVL(*NOMAX)

Here is the result I get now....

     4500 - CPYF FROMFILE(*LIBL/BMHSP100) TOFILE(QTEMP/BMHSP100X)
     FROMMBR(M202) TOMBR(M102) MBROPT(*ADD) CRTFILE(*YES) INCREL((*IF PRDNO
     *EQ 'E-1182PF       01020102000000000')) FMTOPT(*MAP *DROP)
     ERRLVL(*NOMAX)
   Value in INCREL expression number 1 not valid.
   Copy command ended because of error.

It did insert the blanks as needed at the end of the product number variable,
but I am receiving an extra 17 bytes from somewhere.

I looked at my compiled version of the CLP and it has the variable &FPRDN
defined as 32 in length.

Any Ideas?


+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.