× 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.



Have you tried making &Name equal to ''TEST     '' ?

CHGVAR  &NAME '''TEST    '''

('' = single quite inside quotes.  first ' is for the entire string.  ' ''test  
  '' ' would come
out to ' 'test    ' ')

Regards,

Jim Langston

  From: owner-midrange-l@midrange.com
[mailto:owner-midrange-l@midrange.com]On Behalf Of RBBaird@premsys.com
  Sent: Wednesday, September 27, 2000 8:40 AM
  To: MIDRANGE-L@midrange.com
  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
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.