Is it possible to Concatenate many *CHAR variable in one same type variable. I've created a CL who will read records from one file and concatenate them in one varaible which i will use after in my CL. But after exiting the loop i got a varaible with the last record value so the concatenation doesn't work see my CL below :
AUDLOOP: RCVF RCDFMT(LSTAUTHOS) OPNID(ID01)
MONMSG (CPF0864) EXEC(GOTO ENDPGM2)
CHGVAR VAR(&AUTHO) VALUE(%SST(&ID01_LSTAUTHOS 2 8))
SNDMSG MSG(&AUTHO) TOUSR(CGI_KB)
CHGVAR VAR(&AUD) VALUE(&AUD *CAT &AUTHO)
GOTO CMDLBL(AUDLOOP)
Can someone help with this.
Thanks a lot.
Software/Hardware used:
OS400
ASKED:
October 6, 2010 4:30 PM
UPDATED:
October 7, 2010 12:54 PM
Hi Charlie Thanks for your quick response
it’s ok with *TCAT but i need to keep a blank between varaibles. like this :
variable1 variable2 varaible3 varaiable4
with *TCAT i’m getting this :
variable1variable2varaible3varaiable4
any suggestions
thanks in advance.
Try this
CHGVAR VAR(&AUD) VALUE(&AUD *TCAT ‘ ‘ *CAT &AUTHO)
With this you are putting a single blank after the last valid character and then doing a normal *CAT adding &AUTHNO
Also, if it is possible that &AUTHNO contains a blank, you would have a problem.
To resolve that, replace the ‘ ‘ in my previous example with ‘#’ or any other special character.
it’s ok with *TCAT but i need to keep a blank between varaibles.
Did you try CharlieBrowne’s other suggestion:
Also lookup *BCAT in the manuals
Do you have access to the CL programming manual?
Tom
Great
Thanks Charlie.
Thanks Tom… yes i do have access to CL Manuals.