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 is the advantage of using redefines instead of delaring the variables ?
I have a occurs for 100 times but it has executed 101 time what could be the reason?
What is mean by maxcc
I have dataset DS1 which has records say 1 2 3 4 5 ... ... etc And also I have second dataset DS2 whcih has records 1 3 4 5 6 8 .. ... Both the files are sorted and now I want to compare these files and write it into the third files if the records are matching.
I have a cobol program with a sub program. How ca i find that it is a dynamic call? or static call..?
what is a zoned decimal data type and how it will be stored?
How many types of sorts are there in cobol?
How to remove the spaces at end of each record in the output file Via COBOL program? note: The file has a VB length
How you can delete a record from a ps file in cobol?
What care has to be taken to force program to execute above 16 Meg line?
input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.
db2 variable decimal(15,2) what is the equalent size of cobol variable