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 |
Which of the following files can be OPENed in all the 4 modes? The four modes are INPUT, I-O, OUTPUT and EXTEND. (a) INDEXED (b) RELATIVE (c) SEQUENTIAL (d) All of the above
can we use go to statement inline-perform?
I have PS flat file with 14 records. I want to read from 4th to 9th record and want to write those 6 records (4th record to 9th record) to another PS file (output file). there is no key defined in the input file. I just want read a certain Consecutive records. can any one please give me the procedure division Coding for this. I have coded the below coding but the READ-PARA is performing only 1 time even though I have 14 records in my input file (i.e FILE-1): PROCEDURE DIVISION. A000-SECTION. MOVE 0 TO I. OPEN INPUT FILE-1. IF CHECK-KEY1 > 0 DISPLAY "OPEN ERROR FOR FILE-1, CODE IS:" CHECK-KEY1 END-IF. OPEN EXTEND NEWFILE-1 IF CHECK-KEY3 > 0 DISPLAY "OPEN ERROR FOR NEWFILE-1 COD IS" CHECK-KEY3 END-IF. PERFORM READ-PARA THRU EXIT-PARA UNTIL EOF-REC = 'YES'. DISPLAY " FINALLY OUT OF LOOP" CLOSE FILE-1 CLOSE NEWFILE-1 STOP RUN. READ-PARA. ADD 1 TO I READ FILE-1 AT END MOVE 'YES' TO EOF-REC IF I > 3 AND < 10 PERFORM WRITE-PARA ELSE DISPLAY "NOT IN RANGE" END-IF. EXIT-PARA. EXIT. WRITE-PARA. WRITE NEW-REC FROM FILE1-REC.
i have two file, each file having : file1 is having 2 fields field1 field2 file2 is having 3 fields field1 field2 field3 my req is to make it one file like: field1 field2 field1 field2 field3 if anyone know please send me syntax, i tried this with DFSORT but could not succeed.
CAN ANY ONE HELP WHAT IS QTP? why it is nessery AND WEN IT IS USED?
Mention the guidelines to write a structured cobol program?
What is R-mode and A-mode?
What is the Purpose of POINTER Phrase in STRING command in COBOL?
How do u sort the table for Search ALL? Is it only using ASCENDING KEY IS statement in occurs clause? If the data is input in non ascending order, will the ASC KEY IS automatically sort the data? or will it throw compile time error?
what is a load module ?
What is the reference modification.
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly