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 move the records from file to array table. give with code example
There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.
What is the default value(s) for an initialize and what keyword allows for an override of the default?
Name the divisions, which are available in a cobol program?
how do you reference the rrds file formats from cobol programs
How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?
What is the default value(s) for an initialize? What keyword will allow for an override of the default?
Define static linking and dynamic linking.
What rules are to be followed while using the corresponding options?
how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)
Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.
What are 77 levels used for?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
what are decleratives in cobol?
What is report-item in COBOL?