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 |
what happens when a copybook variables are declared using include statement ?
Can we MOVE X(9) to 9(9) OR 9(9) to X(9)? If yes what are the ways for doing this?
12 Answers T systems, Tech Mahindra,
whats the disadvantage of search all over search?
which one is better among static call and dynamic call?
COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
How many bytes will be allocated for the following record description entries? 01 REC-A. 05 A PIC S9(4). 05 B PIC XXXBXXX. 05 C PIC ____9.99. 05 D PIC S9(5) COMP-3. 05 E PIC 9(3) COMP.
16 Answers IBM, TCS,
wht happens if we dnt give scope terminator ?
Extract only those records from a PS file which are having word 'TEXT' in the records using COBOL? The word TEXT is not present in a particular position in all the records.
What is the maximum size of a 01 level item in COBOL I? in COBOL II?
What is inspect in cobol ?
how the control comes back from subprogram to mainprogram