GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Mainframe  >  COBOL
Go To First  |  Previous Question  |  Next Question 
 COBOL  |  Question 129 of 162    Print  
01 rec1.
02 a pic x(6).
01 b redefines a.
02 c occurs 6 times pic 9.
01 d occurs 6 times.
02 e pic x(5).
02 f pic 999.

what is the length of rec1?

  
Total Answers and Comments: 2 Last Update: August 02, 2008     Asked by: gowri41 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
February 14, 2008 03:24:51   #1  
dpg_25 Member Since: February 2008   Contribution: 2    

RE: 01 rec1. 02 a pic x(6).01 b redefines a. 02 c occurs 6 times pic 9.01 d occurs 6 times. 02 e pic x(5). 02 f pic 999.what is the length of rec1?
The length of rec1 is 6 bytes but the code is wrong. You can't redefine 01 level field with 02 level field. Redefined and redefining variables should be at the same level.

If your code looks like the following:
01 rec1
02 a pic x(06).
02 b redifines a.
03 c occurs 6 times pic 9.
01 d occurs 6 times.
02 e pic x(5).
02 f pic 999.

Then the length of the field rec1 becomes 12 bytes.
and length of the field d is 48.

 
Is this answer useful? Yes | No
August 02, 2008 07:28:14   #2  
hmp_8304 Member Since: August 2008   Contribution: 3    

RE: 01 rec1. 02 a pic x(6).01 b redefines a. 02 c occurs 6 times pic 9.01 d occurs 6 times. 02 e pic x(5). 02 f pic 999.what is the length of rec1?

Length of rec1 is 6 Char


 
Is this answer useful? Yes | No

 Related Questions

The PERFORM and END-PERFORM statements bracket all COBOL II statements between them. The COBOL equivalent is to PERFORM or PERFORM THRU a paragraph. In line PERFORMs work as long as there are no internal 
Latest Answer : In In-line PERFORM the procedure name is omitted. An In-line PERFORM must be delimited by the END-PERFORM statement.SYNTAX:          PERFORM                   ...

LENGTH acts like a special register to tell the length of a group or elementary item.  
Latest Answer : Length is an Intrinsic function in Cobol which returns number of characters in any variable. ...

Latest Answer : It is 32767, irrespective of VSAM or non VSAM. In case of VSAM you will have to give no SPANNED while DELETE-Defining the cluster. IF any doubts you can verify creating in mainframes. ...

Latest Answer : Yes, it can be used at 01 level but cannot be used at 77 level. ...

Latest Answer : An explicit redefines can be used at any level number except 01. An implicit redefines can occur if multiple 01s are coded for the same file. ...

In the example below 05 WS-VAR1 PIC X(5),05 WS-VAR2 REDEFINES WA-VAR1 PIC 9(5),PROCEDURE DIVISION MOVE 'ABCDE' TO WS-VAR1.Now what is the value of WS-VAR1 and WS-VAR2 ?

Latest Answer : What would you say about this piece of code?01  WS-VARIABLE PIC X(5).                              01  ...
Read Answers (24) | Asked by : vinayk

1) Is more than one record description is allowed in a FD?2) Is NUMERIC EDIT fields can be used for Arithmatic operations?3) Is COMPUTE P,Q,W = A+ B/C -E ** 2 is a valid statement?4) Is LINKAGE SECTION is mandatory in a sub program?5) In edit fiels the character used for check protection is __________6) COMP-2 occupies _________ bytes?7) Maximum length of a numeric item ________ ?

Latest Answer : hi,See 01 level contains file header. so u can't use occurs clause for header file. You can use occurs clause only for table elements. ...
Read Answers (4) | Asked by : Robin Gulla

Is it possible that the REDEFINES clause has different picture clauses compared to the one it redefined?
Read Answers (9) | Asked by : unica


 Sponsored Links

 
Related Articles

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

Mainframe Features

Mainframe Features In this Mainframe tutorial you will learn about features of Mainframe Processing power memory capacity performance computing multiple operating system time sharing reliability serviceability availability clustering technology and other features available in Mainframe mosgoogle cen
 

Importance of Proper English during Job Interview

Importance of Proper English during Job Interview Your job interview is crucially important and it will determine whether or not you will get the job Depending on the type of job you re going for it is very important for you to use proper English In most cases jobs which offer higher salaries will h
 

HR Interview - HR Interview Mistakes You Will Want To Avoid

HR Interview Mistakes You Will Want To Avoid The job interview can be a stressful process This is especially true for those who are going after a competitive position Your nonverbal communication combined with the answers you give during the interview will determine if you are hired mosgoogle While
 

HR Interview - Behavioral HR Interviews

Behavioral HR Interviews As the name implies a behavioral interview is an interview that is held by a human resources department to determine if an applicant has the behaviors that are appropriate for a job The company must know how an applicant will behave in a certain situations mosgoogle The logi
 

HR Interview - How To Prepare For Your HR Interview

How To Prepare For Your HR Interview Before you begin thinking about how you are going to dress for the interview it is important to do your research first You should learn everything you can about the company you wish to work for When you have detailed information about your employer you will conve
 

HR Interview - Telephone Interview Etiquette

Telephone Interview Etiquette When you conduct a telephone interview for a job it is important to show the proper etiquette Not only is it important it is critical is you wish to be hired by the company There are a number of things you will want to do and other things should never be done mosgoogle
 

HR Interview - How To Succeed At HR Interviews

How To Succeed At HR Interviews There are a number of things you will need to do in order to make sure you pass the interview process Your appearance is something that you will want to pay close attention to Even if you feel that your appearance shouldn t be a factor in whether or not you re highere
 

HR Interview - Do's and Dont's in a HR Interview

Do s and Dont s in a HR Interview There are a number of things that you will want to avoid during the HR interview process While some of these things are directed at the interviewer the other things are directed at the applicant If interviewers fail to follow the proper procedures throughout the int
 

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