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

The below is the declaration for a variable ws 01 ws pic 9(3). if you want to insert space how will you do that. in which level u should do it

3 Answers   ADP,


What are some examples of command terminators?

1 Answers  


I want ALL ERROR codes in VSAM

3 Answers   American Express, TCS,


Can we change the password using ALTER? anyone tried and changed?

0 Answers   IBM,


The hierarchy of the execution of logical operators is (a) NOT AND OR (b) AND OR NOT (c) OR AND NOT (d) OR NOT AND

10 Answers   Huawei, IBM, TCS,






77 a pic x(4) value '1234' -----> instead of this 'abcd' 77 b pic 9(4) value zeros. move a to b what is the answers for both cases? IS it possible? Give me elementary move rules briefly......

8 Answers  


What is the difference between CALL BY VALUE and CALL BY CONTENT?

7 Answers  


I have a sequential file. How do I access a record in this sequential file randomly in my program ?

8 Answers   CGI, Xansa,


consider the following FD FILE-1 01 REC-1 PIC X(80) ...... WORKING-STORAGE SECTION 01 W-REC PIC X(90) ........ PROCEDURE DIVISION FIRST-PARA ....... READ FILE-1 INTO W-REC AT END MOVE 1 TO EOF-FLAG which of the following is true with respect to the above? a.REC-1 will contain nothing and W-REC will contain the contains of the record read b.REC-1 and W-REC contain the same data c.syntex is invalid and error will occur d.REC-1 and W-REC must be of same size

1 Answers   TCS,


How many bytes S(8) comp field occupy and its maximum value?

0 Answers  


Can printer files (having 133 characters) be of variable length?

3 Answers  


Which of the following characters is NOT valid in column 7? a. - b. \ c. * d. # e. $

4 Answers  


Categories