Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AS/400 CL help

Status
Not open for further replies.

wtrepani

MIS
May 30, 2002
93
0
0
US
Hi all,

I hope someone will be able to help me. I am writing a cl to monitor some things on the system. I have a var, lets call it 'A'. It is defined out of a pf as length 25. This is because the value will range anywhere from 1 to 25 positions. When I do a 'if cond(&A *eq &B)' when &B is '1' and &A is '1', it fails the check and shows &A as '1 '. I need someway of truncating the blanks out of the variable value. I tried doing 'if cond('*tcat &A *tcat' *eq &B)', and some other things with *tcat, and it did not work.

Any ideas on how I can do this???

Thanks

Will
 
Never mind, I figured it out.

"

dcl var(&cmd) type(*char) len(1024)
dcl var(&newset) type(*char)
dclf file

crtdtaara dtaara(qtemp/temp) type(*char)
rcvf
chgvar var(&cmd) value('chgdtaara dtaara(qtemp/temp) value(''*tcat &setting *tcat '')')
call pgm(qsys/qcmdexc) parm (&cmd 1024)
rtvdtaara dtaara(qtemp/temp) rtnvar(&newset)
if cond(&newset *ne &b) then...

"

and it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top