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 can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?
Under which scenario you would go for a static call as opposed to dynamic call?
how to access vsam files in cobol and how to differentiate that this is ESDS file
how will u find out 3rd week's 2nd day using occurs ?
The following entries appear in the WORKING-STORAGE SECTION: 01 DATE-TODAY. 05 YY PIC XX VALUE "90". 05 MM PIC XX VALUE "12". 05 DD PIC XX VALUE :31". 01 DATE-EDIT PIC XX/XX/XX. MOVE DATE-TODAY TO DATE-EDIT. (a) 901231 (b) 90/12/31 (c) 31/12/90 (d) 311290
subscript and index r not coded in u r application program what will happen?
if a dataset is already created with fixed length but after that i want to change fixed length to variable length then how is it possible
In an EVALUATE statement, can I give a complex condition on a when clause?
1) can we display the index?
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
What guidelines should be followed to write a structured cobol prgm?
Wat is the difference between NEXT and CONTINUE statement in cobol,can any one explain with example.