GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Mainframe  >  COBOL
Go To First  |  Previous Question  |  Next Question 
 COBOL  |  Question 92 of 162    Print  
What is the use of Level 49 in COBOL?

  
Total Answers and Comments: 8 Last Update: March 24, 2007     Asked by: LC Sharma 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
January 16, 2007 04:35:29   #1  
reena        

RE: What is the use of Level 49 in COBOL?
it is the last level of sub group elements.
 
Is this answer useful? Yes | No
January 19, 2007 06:02:56   #2  
spandia Member Since: January 2007   Contribution: 2    

RE: What is the use of Level 49 in COBOL?

For declaring the host variables you can use level numbers 01 through 49 and
77 also. you got it clear


 
Is this answer useful? Yes | No
January 30, 2007 09:14:40   #3  
pbhatt Member Since: January 2007   Contribution: 2    

RE: What is the use of Level 49 in COBOL?
Hi Level 49 is the last sub level and is used to declare identifiers for which we are not sure that what length they can occupy. For exapmle we have a filed NAME in our file and its length is 50 and we want that if name of a person is of 20 chars only rest 30 chars positions could be reused than to leave the space unused.EX. Say our Rec is01 EMP-REC 05 EMPID PIC X(10). 05 DEPT PIC X(20). 49 NAME PIC X(50). 49 ADDRESS PIC X(50). And if NAME is 'PRADEEP' i.e. using only 7 chars out of allocated 50 then the next field ADDRESS will start right from where the NAME filed ends instead of leaving the 43 positions unused.All Please advise me if I am wrong.pradeep
 
Is this answer useful? Yes | No
February 04, 2007 03:05:16   #4  
anil bidave        

RE: What is the use of Level 49 in COBOL?
it is used to define the db2 char in cobolas var char.
 
Is this answer useful? Yes | No
February 04, 2007 03:05:51   #5  
anil        

RE: What is the use of Level 49 in COBOL?
it is used to define the db2 char in cobolas var char.
 
Is this answer useful? Yes | No
February 06, 2007 09:39:56   #6  
Pradeep Bhatt        

RE: What is the use of Level 49 in COBOL?
Yes It is used for VARCHAR type in a Copybook for a DB2 table but the logic is to implement the efficient space utilization which is provided in DB2 by VARCHAR against CHAR.
 
Is this answer useful? Yes | No
February 10, 2007 07:50:59   #7  
cvikrant        

RE: What is the use of Level 49 in COBOL?
It is last sub groups of elemenary items.
 
Is this answer useful? Yes | No
March 24, 2007 14:24:14   #8  
Irina K        

RE: What is the use of Level 49 in COBOL?
You "need" 49 levels to define host variables for VARCHAR cols in DB2. The 1st 49 contains the length of the string; the 2nd the string itself. To move the string you can use refmod or the STRING stmt eg.:
Code:

01 varchar-fld.
49 vf-len pic s9(004) comp.
49 vf-data pic x(00n).

move vf-data(1:vf-len) to ....
PS It's the creator's responsibility to populate vf-len when vf-data is populated. When the data is written to the DB2 table it will only occupy as many bytes as the vf-len indicates even though the PIC of the host variable may be larger.

Also note that there is no "space" fill when the col is loaded into vf-data. If vf-data was 5 bytes and conained "AAAAA" then you loaded the col containing "BB" the result would be "BBAAA"

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
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