Write a program to explain size error.



Write a program to explain size error...

Answer / Abhay Jindal

The following COBOL program demonstrates a Size Error due to a variable being declared with an incorrect length:nnIDENTIFICATION DIVISION.nPROGRAM-ID. SizeErrorExample.nENVIRONMENT DIVISION.nINPUT-OUTPUT SECTION.nDATA DIVISION.nWORKING-STORAGE SECTION.n01 WS-NAME PIC X(20).nPROCEDURE DIVISION.nDISPLAY 'Enter your name:'nACCEPT WS-NAME.nDISPLAY 'Your Name is: ' WS-NAME.nSTOP RUN.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

Hi all, I have a following requirement to write the cobol program. I have to load the 129 variables from input sequential file which are in excel sheet to the cobol inernal table. and after loading into table i have to compare this data with the business file. here compare means controlling the data whether the format(numeric,alpha) is same in the business file and in the table??? i have the same data in input and business file. could anyone please give me any idea of the logic?// i have all the 129 different variables(129rows,1 column)is there .

4 Answers   IBM, Syntel, TCS,


what is the maximum error code in mainframe

2 Answers  


A cobol program to read a file , match it with other if. If match occurs then write it to an output file. If no match then no need to write it.Error log created by program to track any error.

1 Answers  


how can u find out just by seeing wheater it is main program or sub program ? any two ways to identify reply soon ?

2 Answers  


1.Can we define condition-name conditions in FD entry.

11 Answers  


How to delete the records of a dataset through cobol programme?We should not use jcl utilitities like IDCAMS.

2 Answers  


how would find total records in files using seqientional

1 Answers   HSBC,


What are literals?

1 Answers  


What is the file organization clause ?

2 Answers  


Suppose i have a Cobol field of 10 byte. it contains a decimal sign.How to know where is the point location?

1 Answers  


can we use variable picture clause as xx.99 in cobol.

3 Answers  


what is scope terminator

2 Answers   IBM,


Categories