how to remove leading spaces and zeroes in a cobol
variable.is there any easy way to do it

Answers were Sorted based on User's Feedback



how to remove leading spaces and zeroes in a cobol variable.is there any easy way to do it ..

Answer / s.p.reddy

By using edit character Z in PIC clause we can remove
leading zeros

Is This Answer Correct ?    11 Yes 3 No

how to remove leading spaces and zeroes in a cobol variable.is there any easy way to do it ..

Answer / surendra

find the lenght of the leading spaces then move the actual
value of the variables using reference modification to
another working storage variable.

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More COBOL Interview Questions

What is the difference between comp and comp-3 usage?

0 Answers  


What is amode(31)

0 Answers  


How will you find the currepted records in a file

2 Answers  


What is wrong with the following data declaration? 01 W-DATE PIC X(6). 05 DD PIC 99. 05 MM PIC 99. 05 YY PIC 99. (a) Nothing is wrong. (b) Under W-DATE all level 05 items are having a PIC 99 but level 01 has PIC X(6). (c) PIC can't be specified for a group item. (d) DD, MM, and YY are invalid datanames.

6 Answers   Mphasis, TCS,


What is the difference between Global and External Variables?

0 Answers  






file status 00 is checked after opening the file or reading the file

4 Answers   John Deere,


how to pass 100 to s9(4) how r they inserted ?

3 Answers   TCS,


In an EVALUATE statement, can I give a complex condition on a when clause?

2 Answers  


A paragraph PARA-X is to be executed when none of the data names A, B and C have value of 1. Which of the following will achieve this ? (a) IF A NOT = 1 OR B NOT = 1 OR C NOT = 1 PERFORM PARA-X (B) IF NOT A= 1 AND B= 1 AND C = 1 PERFORM PARA-X (C) IF A NOT =1 IF NOT B = 1 OR C= 1 PERFORM PARA-X (C) IF A NOT = 1 AND B NOT = 1 AND C NOT = 1 PERFORM PARA-X

3 Answers   TCS,


In EBCDIC, how would the number 1234 be stored?

2 Answers   TCS,


What are differences between Static Call and Dynamic Call?

10 Answers   IBM, KBC, Keane India Ltd, Verizon,


How to remove the spaces at end of each record in the output file Via COBOL program? note: The file has a VB length

3 Answers   TCS,


Categories