hi
i jaust want to put following string in a variable .
arsdoc delete -h CSPAY -v -i "WHERE ZHSPCODE= 'abc'" -f PRYW2E -G PRYW2E
here i am picking 'abc' part from file .Suppose field is zhsp that contains this part.So string will look something like this :
arsdoc delete -h CSPAY -v -i "WHERE ZHSPCODE= &zhsp" -f PRYW2E -G PRYW2E
But when a am putting this in a variable this is taking &zhsp rather than abc.
please help me out
Software/Hardware used:
as400
ASKED:
September 25, 2010 4:14 PM
UPDATED:
November 15, 2011 2:22 AM
i used this
VAR(&COM) VALUE(‘arsdoc delete -h CSPAY +
-v -i “WHERE ZHSPCODE=’ *cat &ZHSP +
*tcat ”” -f PRYW2E -G PRYW2E’)
its not working this is showing error :
String ”” -f PRYW’ contains a character that is not valid.
Character ”’ not valid following string ‘PRYW2E ‘
A matching apostrophe not found.
help me out !!!!
Assuming this is a chgvar command
VAR(&COM) VALUE(’arsdoc delete -h CSPAY +
-v -i “WHERE ZHSPCODE=’ *cat &ZHSP +
*bcat ‘ -f PRYW2E -G PRYW2E”‘)
Right
1. I don’t think you want a *tcat which would install the value of &ZHSP no space -f
but a *bcat
2. then string must restart ‘-f PRYW2E -G PRYW2E” ‘)
3. don’t know if value of &ZHSP needs to be presented enclosed in quotes ..because I do not know the type of ZHSPCODE or the command you are building arsdoc. But try 1 and 2 and then we’ll deal with 3 if it’s necessary
Phil
yes i need zhspcode in quotes …this is where problem occurs
VAR(&COM) VALUE(’arsdoc delete -h CSPAY +
-v -i “WHERE ZHSPCODE= ”’ *cat &ZHSP +
*tcat ‘” -f PRYW2E -G PRYW2E”‘)
ZHSPCODE = ”’ — three single quotes because two singles mean “paste one quote here” and the third one terminates the string..
*tcat ”’ use *tcat is you don’t want to include any trailing spaces in &ZHSP or *cat if you want to use &ZHSP as is followed by ”’ three single quotes. One quote to start string and two qotes to print a single quote after the value of &ZHSP
Phil
This might be a case where a new variable helps clear things up. Create a variable like this one:
The VALUE() parameter contains four consecutive single-quote marks. Then change:
CHGVAR VAR(&COM) VALUE(’arsdoc delete -h CSPAY + -v -i “WHERE ZHSPCODE=’ *cat &ZHSP + *tcat ”” -f PRYW2E -G PRYW2E’)Make it look like this:
CHGVAR VAR(&COM) VALUE(’arsdoc delete -h CSPAY + -v -i “WHERE ZHSPCODE=’ *cat "e *cat &ZHSP + *tcat "e *cat '” -f PRYW2E -G PRYW2E’)Unfortunately, that’s partially a guess because I can’t tell how many single- and/or double-quote marks are supposed to be in that to begin with.
Tom
Nice.