GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Mainframe  >  COBOL

 Print  |  
Question:  Working Storage Definition

Answer: Consider the follwing snippet:

01 WS-VAR USAGE IS INDEX

Is this a valid working storage definition?
Justify your answer


May 05, 2008 05:28:41 #1
 guraddiv Mainframe Expert  Member Since: April 2008    Total Comments: 19 

RE: Working Storage Definition
 
Hi,

   This is not a Valid definition bcz the USAGE IS INDEX clause is used to provide an optimized table subscript. When a table is the target of a SEARCH statement it must have an associated index item.
     Any item declared with USAGE IS INDEX can only appear in:
        - A SEARCH or SET statement
        - A relation condition
        - The USING phrase of the PROCEDURE DIVISION
        - The USING phrase of the CALL statement
     

 

Back To Question