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 / 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 |
How you can delete a record from a ps file in cobol?
I have a variable account-number declared as comp-3, s9(10) comp-3 in a file. How do i find a particular account number say 123456 in that file?
can u give result for the fallowing example... 05 a pic 9(2) 05 b redifines a pic x(2). move 'xy' to b. display a,b.
What does the INITIALIZE verb do?
2)Where the Plan is located in CICS-DB2?
can we declare occurs in 01 level?
Suppose i have a Cobol field of 10 byte. it contains a decimal sign.How to know where is the point location?
What are the different rules to perform a Search?
What are the divisions in a cobol program? Which one is the mandatory division among them?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
What is CALL statement in COBOL?
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