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



Joel,
Here is an example of what we do:
DCL VAR(&QT) TYPE(*CHAR) LEN(1) VALUE('''')

CHGVAR VAR(&RteQt) VALUE(&QT || &RTE || ' ' || &QT)
CHGVAR VAR(&WhrsQt) VALUE(&QT || &WHRS || &QT)
STRQMQRY QMQRY(FSP965Q1) +
SETVAR((OBJLIB &FCLib) +
(WHSEQT &WhrsQt) +
(RTEQT &RteQt) +
(FCCYMD &FcCymd))

this example is calling a Query Manager Query,
but hopefully you get the idea.

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Stone, Joel
Sent: Friday, November 08, 2013 12:47 PM
To: Midrange Systems Technical Discussion
Subject: battle with CL quotes

I am attempting to make a CL pgm with variables to run a SAV command.


CHGVAR VAR(&DEVICE) VALUE('/QSYS.LIB/' +
*TCAT +
&LIBNAME *TCAT '.LIB/' *TCAT &SAVEFILE +
*TCAT '.FILE' || ''')' )
CHGVAR VAR(&OBJPARM2) VALUE('OBJ' || '((' || +
&OBJPARM || ' ' *TCAT ')')

CLRSAVF FILE(&LIBNAME/&SAVEFILE)
chgvar &SavString (&DEVICE || &OBJPARM2)
SAV &SavString
ENDPGM
Here is the resulting error:

3000 - SAV DEV('/QSYS.LIB/PBACKUP.LIB/NRTEST.FILE'')
OBJ((/HOME/CONTRACTS/NATHANTEST3)')
Matching quote not found in path name.
Error found on SAV command.



So I need to remove one of the quotes in the ''.
I try the following after removing two quote marks after the FILE


CHGVAR VAR(&DEVICE) VALUE('/QSYS.LIB/' +
*TCAT +
&LIBNAME *TCAT '.LIB/' *TCAT &SAVEFILE +
*TCAT '.FILE' || ')' )
CHGVAR VAR(&OBJPARM2) VALUE('OBJ' || '((' || +
&OBJPARM || ' ' *TCAT ')')

CLRSAVF FILE(&LIBNAME/&SAVEFILE)
chgvar &SavString (&DEVICE || &OBJPARM2)
SAV &SavString
ENDPGM


2700 - SAV DEV('/QSYS.LIB/PBACKUP.LIB/NRTEST.FILE)
OBJ((/HOME/CONTRACTS/NATHANTEST3)')
Path name too long.
Specified value on DEV parameter not valid.



Now BOTH quotes are gone!! I think I need to end up with ONE quote, but I can only get zero or TWO quotes.

How can I change CHGVAR to result in ONE quote at the end of the DEV string?

Is there a better way to accomplish a variable parm input to the SAV command? This seems klunky for 1980 era, it is really ridiculous that this is so messy in 2013.

Thanks!





______________________________________________________________________
This outbound email has been scanned for all viruses by the MessageLabs Skyscan service.
For more information please visit http://www.symanteccloud.com ______________________________________________________________________
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.