I want to declare a field with data type Double in my COBOL
program. how shall i do that ?
Answers were Sorted based on User's Feedback
Answer / tarunam
To Declare field with double data type u have to declare it
with comp-2
eg: PIC s9(8) usage is comp-2
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / prasad
With the above answer we can achive decimal numeric
declaration but we will not achive double format
declaration.
To Declare double data type in COBOL we have to decalre
field with COMP-3.
Examples:
WS-NUM PIC 9(4) COMP-3. for non decimal numbers
WS-NUM1 PIC 9(4) v 99 COMP-3. For decimal values.
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / i go crazy
For COMP-2 we will not give PIC clause. By default it takes 8 bytes.
| Is This Answer Correct ? | 2 Yes | 0 No |
Have you used comp and comp-3 in your project? And how?
How many times the loop runs here 01 a pic 9(2) value 10. perform para1 a times stop run. para1: move 20 to a.
Can a REDEFINES clause be used along with an OCCURS clause? if yes, 01 WS-TABLE. 03 WS-TABLE-EL OCCURS 5 TIMES PIC X(1) VALUE 'A'. 03 WS-EX REDEFINES WS-TABLE-EL PIC X(5). What can you expect? if no,why?
if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.
How do u debug a S0C7 abend? (aswered till we get the field which caused that) After knowing the field which caused that how do u know the record which caused that if it is in production env? (dumb) Ok let us assume that we got to know that 100th record caused that and I wanted to skip only 100th record from the file and process from 101th. How to do that in JCL using SORT? (tried with STOPAFT but ended up dumb when he said smthing else is ther)
What rules are followed by the search verb.
Discuss about changing dataset name in proc.
I have a files containing both duplicate and non-duplicate records.The file is already sorted by a key.I want to determine those records that are duplicate and records that are non-duplicate.If duplicate the record is move to a duplicate file and if non-duplicate that will be move to valid file.thank you
Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc
there is a file whose ORGANISATION is INDEXED.you want to read the records from the file in RANDOM fashion as well as sequentially.then which of the access mode would you specify? a.SEQUENTIAL b.RANDOM c.DYNAMIC D.ACCESS MODE has nothing to do with it
What will happen if a variable is declared as below.. Explain with an example? Working storage section:- 01 WS-VARX PIC X(10) VALUE 'ABCDEFGHIJ'. 01 WS-VARN REDEFINES WS-VARX PIC 9(5) VALUE '12345'. What will happen I want Display WS-VARX and WS-VARN?
Can we put move statement in COBOL copybook