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
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 |
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 |
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 |
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 |
Answer / arpan
We need to use Initialize for Numeric and SPACES for Alpha
numeric fields.
| Is This Answer Correct ? | 0 Yes | 1 No |
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 |
Answer / guest
IF I-field-name IS NUMERIC
MOVE SPACES TO I-field-name
END-IF
| Is This Answer Correct ? | 2 Yes | 4 No |
Answer / guest
IF I-field-name EQUAL ZEROES
MOVE SPACES TO O-field-name
END-IF
| Is This Answer Correct ? | 1 Yes | 5 No |
I have a Main Program which is calling Sub-Program which is a DB2 pgm. What will happen if I am not closing the cursor used in the Sub-program? Please advise..
WE HAVE 2 FILES IN COBOL. ONE IS FIXED LENGTH RECORDS ANOTHER ONE IS VARIABLE LENGTH. IF I DECLEAR LRECL OF FIXED ONE AS 80 AND 2ND RECORD AS 132. WHAT WE NEED TO DECLEAR LRECL FOR THOSE 2 FILES IN JCL?
What is an explicit scope terminator?
What are the differences between COBOL and COBOL II?
How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?
What is the utilization of copybook in cobol? Could we utilize a similar copybook?
Can anyone explain me CALL procedure in COBOL.Does it carries similarities like call by reference in C.
Explain complete concept of table handling in COBOL with an example?
I want to declare a field with data type Double in my COBOL program. how shall i do that ?
how do u link sub pgm to main pgm ?
how do u indetify files succesfully executed or not ?
What is an index for tables?