GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  TCS  >  COBOL
Go To First  |  Previous Question  |  Next Question 
 COBOL  |  Question 6 of 44    Print  
what if any, is the syntax error in the following piece of code
01 B PIC A(7)
02 C PIC 9(4)
IF(B NUMERIC)
ADD 10 TO C
a.the condition in the if statement is wrong
b.noting is wrong
c.because C is initialised.ADD 10 TO C is wrong
d.both B and C shoud have same size.

  
Total Answers and Comments: 2 Last Update: June 15, 2006   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
April 05, 2006 08:26:42   #1  
Kiran        

RE: what if any, is the syntax error in the following ...

Ans:- a(the condition in the if statement is wrong)

For the Variable declared as alphabetic the valid test conditions are

A IS [NOT]ALPHABETIC

A IS [NOT]ALPHABETIC-LOWER

A IS [NOT]ALPHABETIC-UPPER

Where [NOT] is optional...


 
Is this answer useful? Yes | No
June 15, 2006 11:32:40   #2  
sharmilabit Member Since: June 2006   Contribution: 3    

RE: what if any, is the syntax error in the following ...
ANS IS b. nothing is wrong....because it won't give any compilation or run time error. its just that the condition won't be satisfied and 10 will not be added to C and since C has not been assigned any value nothing would be displayed. test it if u have doubt.
 
Is this answer useful? Yes | No

 Related Questions

Consider the following piece of code 01 GROSS-PAY 05 BASIC-PAY PIC 9(5) 05 ALLOWANCES PIC 9(3) if BASIC-PAY has a value 1000 and ALLOWANCES has a value of 250, what will be displayed by the statement DISPLAY GROSS-PAY a.1250 b.01000250 c.01250 d.1.250

Consider two data items 77 W-A PIC 9(3)V99 VALUE 23.75 77 W-B PIC ZZ9V99 VALUE 123.45 after the statement MOVE W-A TO W-B what will be W-B value? a.123.75 b.b23.75 (where b indicates space) c.023.75 d.invalid move

Consider the statement (incomplete) IF(A NUMERIC) DISPLAY A the variable A can be a.NUMERIC b.ALPHABETIC c.ALPHANUMERIC d.NUMERIC OR ALPHANUMERIC

What if any, is the syntax error in the following piece of code 01 B PIC A(7) 02 C PIC 9(4) IF(B NUMERIC) ADD 10 TO C a.the condition in the if statement is wrong b.noting is wrong c.because C is initialised.ADD 10 TO C is wrong d.both B and C shoud have same size.

Observe the following code 01 A1 05 B PIC 99 05 C PIC X(4) 01 A2 05 B PIC 99V99 05 C PIC A(4) pick out the valid statement from the following a.A1 and A2 can not have sub-ordinates b.A1 and A2 can have the same sub-ordinates but must have same PIC clause c.there is nothing wrong d.A1 and A2 can have same sub-ordinates provided they are not at 01 level

Study the following 01 A PIC 99V0 VALUE 5 01 B PIC 9V9 VALUE 6 01 C PIC 99V9 VALUE 2.5 01 D PIC 99 VALUE 3 COMPUTE A ROUNDED B C = A+B*C/D ON SIZE ERROR PERFORM PRINT-ERROR the comments of A.B.C after execution of the above statement are a.A=10 B=0 C=10 b.A=10 B=9.9 C=9.9 c.A=10 B=0 C=9.9 d.A=10 B=6 C=10

Consider the following piece of code 01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP VALUE 50 05 AMOUNT-2 PIC 9(4)V99 USAGE COMP MOVE ZERO TO GROUP-ITEM ADD 50 TO AMOUNT-1 what will be the content of AMOUNT-1? a.50 b.100 c.0 d.unpredictable

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

Consider the following FD FILE-1 01 REC-1 PIC X(80) ...... WORKING-STORAGE SECTION 01 W-REC PIC X(90) ........ PROCEDURE DIVISION FIRST-PARA ....... READ FILE-1 INTO W-REC AT END MOVE 1 TO EOF-FLAG which of the following is true with respect to the above? a.REC-1 will contain nothing and W-REC will contain the contains of the record read b.REC-1 and W-REC contain the same data c.syntex is invalid and error will occur d.REC-1 and W-REC must be of same size

Consider the following PROCEDURE DIVISION entry OPEN EXTEND IN-FILE identify the correct statement a.organization of IN-FILE is sequential and records can be added in the beginning b.organization of IN-FILE is sequential and records can be added in the end c.organization of IN-FILE is indexed and records can be added in the beginning d.organization of IN-FILE is indexed and records can be added in the end


 Sponsored Links

 
Related Articles

jQuery Table Row Finished Code

jQuery Table Row Finished Code The Finished Code Our second example page has demonstrated table row striping highlighting tooltips collapsing expanding and filtering Taken together the JavaScript code for this page is mosgoogle geshibot lang php" document ready function var highlighted
 

jQuery Interacting with Other Code

jQuery Interacting with Other Code We learned with our sorting and paging code that we can t treat the various features we write as islands The behaviors we build can interact in sometimes surprising ways; for this reason it is worth revisiting our earlier efforts to examine how they coexist with t
 

jQuery Completed sorting and paging code

Learning jQuery The Finished Code The completed sorting and paging code in its entirety follows mosgoogle geshibot lang php" fn alternateRowColors function tbody tr odd this removeClass even addClass odd ; tbody tr even this removeClass odd addClass even ; return this; ; document
 

What are the limitations with switch statement?

Switch statement is a powerful statement used to handle many alternatives and provides good presentation for C program. But there are some limitations with switch statement which are given below: Logical operators cannot be used with switch statement. For instance case k>=20: is not allowe
 

goto Statement

Why to avoid goto in C C has goto statement but one must ensure not to use too much of goto statement in their program because its functionality is limited and it is only recommended as a last resort if structured solutions are much more complicated. First let us understand the goto statement, its
 

Quality Aspects to Check While Writing COBOL Program

Quality Aspects to Check While Writing COBOL Program This article gives a general list which the programmer must check while delivering programs developed in COBOL This can also be used as a general checklist for checking quality of the COBOL program developed mosgoogle Quality is a vital factor fo
 

The Use of Trial and Error To Solve Problems

The Use of Trial and Error To Solve Problems Some complex problems can be solved by a technique that is called trial and error Trial and error is typically good for problems where you have multiple chances to get the correct solution However this is not a good technique for problems that don t give
 

How Code Reviews and PMD Can Crush Bugs In Your Code

How Code Reviews and PMD Can Crush Bugs In Your Code The ability to review your code is one of the best methods to find bugs and other issues which can cause your program to perform poorly In fact one of the hardest things about writing a program is debugging it When programmers get together and sha
 

WebSphere V5.0 : Debugging - Step-through code

WebSphere V5 0 Debugging Step through code In this tutorial you will learn about WebSphere V5 0 Debugging Stepping through the execution of a Java program Step over Step into Run to return and Run to line mosgoogle Stepping through the execution of a Java program When a thread is suspended the step
 

PHP Tutorial - Syntax

PHP Tutorial Syntax In this tutorial you will learn about PHP Syntax Syntax for Writing a script Scripts VS File and Comments mosgoogle Writing a script To embed PHP code inside a file it has to be inside a special set of opening and closing tags PHP supports the following tags sets 1 Opening php
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape