Posted: Thu Aug 06, 2009 5:02 pm Post subject: STRING in cobol
hi, i have a req it says that,
Var1 to var 14 : each 6 character length. each one i will read from the array.
ex: Var1 = 'bala ', var2 = 'ji '
when i do, STRING VAR1 ',' VAR2 ','..........
i will get 'bala ,ji ' but i dont want that. i want 'bala,ji'. basically the spaces after the acharacter sholud be truncated and i could do this for 14 variables.
first time i am moving the var1 to temp.
var1 has ' bala' but the length is 60.
second time i am doing string of var2 and temp into temp.
third time i am doing string of var3 and temp into temp.
like this its going on for 14 times.
so every time temp will get somee value and the next var will get concat to it.
temp var length is 850.
first tim its working fine. but the second time temp itself has a pic clause of 850. so the string option is not working.The data inside the temp is 10 to 20 charaters only.
problem is when its doing the second loop it sld take only the content length only not the var length.
there is an interm data area presented to the INSPECT statement by FUNCTION reverse.
what would be a replacing phrase for an interm data area accomplish?
why are you FUNCTION REVERSing?
you started this thread wanting to eliminate trailing spaces, before stringing variable contents.
now you want to what, replace them with zeroes?
get your head out of your butt,
and describe exactly what it is that you want to do. _________________ Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum