× 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: Re: MIDRANGE-L Digest V3 #727
  • From: "Peter Dow" <pcdow@xxxxxxxxx>
  • Date: Wed, 27 Sep 2000 13:26:23 -0700

Hi Rick,

That's pretty interesting. I would've thought it would use the length of the
variable &NAME.  Anyway, as a workaround you could construct the CPYF
statement in a field like &CMD with the correct quote placement and call
QCMDEXC to execute  it.  That way you're putting the quotes around the
value,  not CPYF.

        DCL  &CMD *CHAR 256
        DCL  &CMDLEN *DEC (15 5) VALUE(256)
        CHGVAR &CMD 'CPYF FROMFILE(file1) TOFILE(lib1/file2)
                    MBROPT(*REPLACE) CRTFILE(*YES)
                    INCREL((*IF DQNAME *EQ ''TEST      ''))'
        CALL QCMDEXC (&CMD &CMDLEN)



HTH
Peter Dow
Dow Software Services, Inc.
909 425-0194 voice
909 425-0196 fax

----- Original Message -----
From: RBBaird@premsys.com
To: MIDRANGE-L@midrange.com
Sent: Wednesday, September 27, 2000 7:40 AM
Subject: Re: MIDRANGE-L Digest V3 #727


Hey all,
I've got a problem, and I truly believe IBMs implementation of this feature
is wrong, but it IS documented in the CL reference manual.
According to IBM, the cpyf command INCREL parameters works this way when
character fields are compared to strings:
"If a value is specified for a character field that is shorter than the
actual field, the comparison is performed using only the length of the
character string value".
So.... I have a file with the following values:
DQNAME
------
TEST
TEST
TEST1
TEST1
TESTONE
TESTONE
OTHER
I call a CLP.  the value of &NAME is 'TEST      '
       DCL        VAR(&NAME)    TYPE(*CHAR) LEN(10)
      CPYF       FROMFILE(file1) TOFILE(lib1/file2) +
                    MBROPT(*REPLACE) CRTFILE(*YES) +
                    INCREL((*IF DQNAME *EQ &NAME))
Which, when run, interperates to
       CPYF       FROMFILE(file1) TOFILE(lib1/file2) +
                    MBROPT(*REPLACE) CRTFILE(*YES) +
                    INCREL((*IF DQNAME *EQ 'TEST'))
Which copies the first 6 records in the above example, not, as I could have
sworn it should have done, just the first two.
This, I firmly believe, is VERY wrong!!!!!  Being that as it may, I still
need a work around.
What I need to do is to append at least one space on the end of the
character string.
I've tried concatonating quotes around the variable several different ways,
but am hitting a brick wall.
The problem is that the copy file command automatically puts the quotes
around char strings, which is giving me fits.
Anyone have any idea of a workaround?
Thanks,
Rick
+--- | This is the Midrange System Mailing List! | To submit a new message,
send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send
email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send
email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to
the list owner/operator: david@midrange.com +---


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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 ...

Replies:

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.