In a file if a column account number conatain value 0001234.. how can we move the value to another variable without zero. value may contain any type such as 00123405. we need the value 1234 or 12305. how can we do that in cobol. Please help.
Answer Posted / mahesh satya
variable pic 9(08).
perform varying I from 1 by 1 until I < 8 or found
IF VARIABLE(I:1) not = 0 then
compute actual = 8 - I
move VARIABLE(I: actual) to NEW_VARIABLE
set found to true
end-if
end-perform
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to use the same COBOL program in Batch and CICS on lines? explain with an example
Can a Search can be done on a table with or without Index?
Write some characteristics of cobol as means of business language.
how do you reference the variable block file formats from cobol programs
Discuss about changing dataset name in proc.
In COBOL programming, what is PERFORM? What is VARYING?
Name the divisions, which are available in a cobol program?
How you can characterize tables in cobol?
What is amode(31)
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
What is the default value(s) for an initialize? What keyword will allow for an override of the default?
Have you used comp and comp-3 in your project? And how?
What type of SDLC u followed? Why?
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com
How can we find that module can be called – whether DYNAMICALLY or STATICALLY?