how to refer the data field?



how to refer the data field?..

Answer / Atiya Parveen

In COBOL, you can refer to a data field using its label or by position (using PIC and REDEFINES). For example:
```
01 EMPLOYEE.
05 NAME PIC X(20).
05 AGE PIC 99."
"
To refer to the data field, you can use the following ways:
- By label: `NAME` or `AGE`
- By position: `EMPLOYEE.1` for `NAME`, `EMPLOYEE.3` for `AGE`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

there is a file whose ORGANISATION is INDEXED.you want to read the records from the file in RANDOM fashion as well as sequentially.then which of the access mode would you specify? a.SEQUENTIAL b.RANDOM c.DYNAMIC D.ACCESS MODE has nothing to do with it

3 Answers   TCS,


I have a files containing both duplicate and non-duplicate records.The file is already sorted by a key.I want to determine those records that are duplicate and records that are non-duplicate.If duplicate the record is move to a duplicate file and if non-duplicate that will be move to valid file.thank you

1 Answers  


Which mode is used to operate the sequential file?

1 Answers  


What type of Call you would use if you don;t want the control back to the calling program?

8 Answers   TCS,


How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?

1 Answers  


Why would you use find and get rather than to obtain?

1 Answers  


Using string statement.Is coding three destination string from one source string possible in one code?or three codes for every destination string of one source string.?thank you

1 Answers   BPL,


Consider the following code: 77 A PIC 99V99 VALUE 55.35 77 B PIC 99V999 VALUE 32.754 ADD B TO A ON SIZE ERROR DISPLAY "ERROR!!!" What will be the result ? (a) A=88.10, B=32.754 (b) A=87.00 B=32.754 (c) A=87.10 B=32.754 (d) ERROR!!! will be DISPLAYed on the screen.

3 Answers   TCS,


What is inspect in cobol ?

1 Answers   Infosys,


What is COMP-1? COMP-2?

4 Answers   CitiGroup,


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

1 Answers  


What is the difference between working storage copybook and linkage section copybook?

5 Answers   TCS,


Categories