1. Explain Is it possible to code GOTO statement in NATURAL? if yes please provide the syntax of the same?

No, There is not GOTO statement in Natural.
There is a Perform statement which is used to call a
subroutine.
A subroutine is a a block of code which is to be executed
several times within an object.

3. Explain why do we use file-aid for seqential files?

We use File aid for sequential files for the following
reason:

1. Copy from one file to another only selected amount of
records.
2. To browse or edit through the file using a copybook.
3. For impact analysis on a particular file.

4. Explain how to ftp the natural program to desktop? (from mainframe to pc), is it possible?

Yes, it is possible. The below JCL can list the source of
the Natural program to a dataset and it can be very well
downloaded using option 6.

//STEP1 EXEC NATBATT
//SYSOUT DD SYSOUT=*
//CMPRINT DD DSN=USERID.MYNATPGM,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(1,1),RLSE),RECFM=FBA,LRECL=133
//SYSIN DD *
LOGON NATLIB
L MYNATPGM
FIN
/*
NATLIB = YOUR NATURAL LIBRARY
MYNATPGM = YOUR NATURAL PROGRAM

5. How do you pass data from a Natural Program to an External Subroutine? Can it share the LDA of Program as in Internal Subroutine?

Parameters can be passed with the PERFORM statement from
the invoking object to the
external subroutine. These parameters must be defined
either in the DEFINE DATA PARAMETER
statement of the subroutine, or in a parameter data area
used by the subroutine.
An external subroutine can access the global data area used
by the invoking object.
In addition, an external subroutine can have its own local
data area, in which the fields that are to be used
only within the subroutine are defined.
However, an external subroutine cannot have its own global
data area.

6. What happens when you issue a ESCAPE ROUTINE in a program?
Will there be any compilation /Run time erro?

Escape Routine is generally used to interupt the processing
of Subprogram or Subroutine to return Control back to the
next statement from where this subprogram or routine was
called.

This statement will return an error if not placed within a
subprogram, subroutine or processing loop.

7. Suppose You are processing an input file in a Natural program and you want the program to fail if the file is empty. What command you use in Natural to force it to fail?

You use the following steps to check whether the input file
is empty

Step A. Read work file #WK-Number once #WK-Record
Step B. At End of File
Write "Input file is Empty"
End-Endfile

The first step will read the first record in the file and
the next step will see the End of File condition. If the
File is empty, the program will write that we have an Empty
input file to spool.

8. Explain the difference between External subroutine and
subprogram?

An External Subroutine has got access to the Caller's GDA
where in the subprogram does not have.

The subprogram is like blackboxes as they are not aware of
the caller's environemnt. They take only the parameters and
process it and return the values. e.g. One natural
subprogram can be called through middle tiers like Entirex
and Vitria from a different environment(Lets say a dot net
or java developed web interface).However a similar
interface can not call a natural external subroutine.

As far as calling is concerned you use callnat for
subprogram and perform for external subroutine.

10. What is COBOL coding sheet?

1-6 sequence numbers.

7 (*) for comment (-) for continue (D) for debugging.

8-11 called as Area-A in this Area we can write
Divisions,Paragraphs,sections,Level numbers.

12-72 called as Area-B in this area we can write cobol
executable statements like select,accept,display.

73-80 is ignored area by compiler but we can see in source
Listing.

Download Interview PDF