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 fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
) How do u handle errors in BMS macro?
What is perform what is varying?
In which area will you utilize 88 level items in cobol?
What is redefines clause in COBOL?
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
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?
How many sections are there in data division in COBOL?
Can we change the password using ALTER? anyone tried and changed?
What are 77 levels used for?
What kind of error is trapped by on size error option?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
Describe the cobol database components?
2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic