I encountered an error when I move spaces to a numeric
field?What should I do to move spaces on that field?help
please.

Answers were Sorted based on User's Feedback



I encountered an error when I move spaces to a numeric field?What should I do to move spaces on th..

Answer / ramesh

first numeric field rediffens alpha numeric field
then you check numeric and move spaces to redifened name
ex:
01 num pic 9(09).
01 num1 rediffens num.
02 num2 pic x(09).

if num is numeric
move spaces to num2
end-if.

Is This Answer Correct ?    20 Yes 0 No

I encountered an error when I move spaces to a numeric field?What should I do to move spaces on th..

Answer / mahesh

Thing is that spaces can't be moved to numeric fields,
u can move only zeros and other numeric values to numeric
fields, spaces can be moved to alphanumeric and alphabetic
fields only.

Is This Answer Correct ?    7 Yes 0 No

I encountered an error when I move spaces to a numeric field?What should I do to move spaces on th..

Answer / nitesh sethi

Use option BLANK WHEN ZERO for that field and initialize
that field.
Initalize will move zeroes to that field and declarion of
that field with BLANK WHEN ZERO will not have zeroes in
that field.

Directly moving spaces to a numeric field is not possible
as it will result in SOC7 Abend

Is This Answer Correct ?    0 Yes 0 No

I encountered an error when I move spaces to a numeric field?What should I do to move spaces on th..

Answer / sundar

Directly move space to numeric fields encount severe error.
But if you move space to another alphanumeric field and
then move to numeric field then this will not get any error.

Is This Answer Correct ?    0 Yes 0 No

I encountered an error when I move spaces to a numeric field?What should I do to move spaces on th..

Answer / arpan

We need to use Initialize for Numeric and SPACES for Alpha
numeric fields.

Is This Answer Correct ?    0 Yes 1 No

I encountered an error when I move spaces to a numeric field?What should I do to move spaces on th..

Answer / sundar

Move space to the numeric field not getting any error.
However if that numeric field involves any arithmatic
operation than it will get abend.

Is This Answer Correct ?    0 Yes 1 No

I encountered an error when I move spaces to a numeric field?What should I do to move spaces on th..

Answer / guest

IF I-field-name IS NUMERIC
MOVE SPACES TO I-field-name
END-IF

Is This Answer Correct ?    2 Yes 4 No

I encountered an error when I move spaces to a numeric field?What should I do to move spaces on th..

Answer / kanika

intialize will solve the purpose.

Is This Answer Correct ?    1 Yes 4 No

I encountered an error when I move spaces to a numeric field?What should I do to move spaces on th..

Answer / guest

IF I-field-name EQUAL ZEROES
MOVE SPACES TO O-field-name
END-IF

Is This Answer Correct ?    1 Yes 5 No

Post New Answer

More COBOL Interview Questions

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

0 Answers  


01 var1 pic s9(9)v99. 01 var2 pic x(30). procedure division. move 12345.99 to var1. move12345.99 to var2. display var1. display var2. what is the output?

2 Answers   IBM,


What does the initialize statement do ?

2 Answers  


Which of the following EDITind and PICTURE symbols is to be used if a minus(-) is to appear before the value if the value is -ve and a plus(+) is to appear before the value if the value is +ve? (a) + (b) - (c) + OR (d) It is not possible

7 Answers   TCS,


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

0 Answers  






What are options have been removed in COBOL 11?

1 Answers  


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.

1 Answers   CSC,


i WANT ALL ERROR codes IN CICS and DB2

2 Answers  


consider the following progrm statements MOVE 0 TO SW.NO.OF.REC PERFORM PRI-OUT UNTIL SW=1 DISPALY NO.OF.REC STOP RUN PRE-OUT READ IN-FILE AT END MOVE 1 TO SW WRITE OUO-REC FROM IN-REC ADD 1 TO NO.OF REC if the IN-FILE contains 1000 records what value will be displayedafter the PERFORM is over?assume that N0.OF.REC has PIC 9(4) a.1000 b.1001 c.1 d.none of the above since there is a syntex error

4 Answers   TCS,


What are different file OPEN modes available in COBOL?

4 Answers   Sun Life,


in how many mode we can open a file ?

4 Answers  


SSRange is used to do a range check on which of the Following. SUBSCRIPT,INDEX,REFERENCE MODIFICATION,Run-time option.

3 Answers   Lehman Brothers,


Categories