Page 1 of 1

Use of AS in ESDS

PostPosted: Wed Oct 24, 2012 12:36 pm
by gowthamgyaa
Hi everyone,
Why should i use AS in my select statement for ESDS physical file?
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
            SELECT INFILE ASSIGN TO AS-SYSUT1.
           


kind Regards
gyaa

Re: Use of AS in ESDS

PostPosted: Wed Oct 24, 2012 12:46 pm
by BillyBoyo
What do the manuals tell you about it? Have you tried removing "AS-"?

Re: Use of AS in ESDS

PostPosted: Wed Oct 24, 2012 1:11 pm
by gowthamgyaa
Hi,
I Removed AS and wrote a code it shows an abend sco4.


Kind regards
gyaa

Re: Use of AS in ESDS

PostPosted: Wed Oct 24, 2012 1:51 pm
by BillyBoyo
What did the manuals tell you about it?

You need to research before you come here with questions. You have colleagues or a Trainer. You have the manuals. You have the internet. On top of that, you can do, as you now did, a little program to try something out.

If you can start trying to "learn how to learn about mainframe stuff" you'll find it is invaluable in your future career. Just giving up answers to you will be less valuable to you.

Re: Use of AS in ESDS

PostPosted: Wed Oct 24, 2012 2:21 pm
by Robert Sample
The manual not only tells you what you CAN do, it also tells you what you MUST do. For example, you cannot run a COBOL program without one of the four divisions. And if you are using a VSAM ESDS file, you cannot omit the AS- on the ASSIGN statement.

Re: Use of AS in ESDS

PostPosted: Wed Oct 24, 2012 5:00 pm
by Robert Sample
Update: actually, after checking the manual (thanks BillyBoyo for the suggestion), the ONLY required DIVISION is IDENTIFICATION. If your program is not using any files or special characters, you can get by without the ENVIRONMENT DIVSIION. There's not much use, however, for a program missing the DATA DIVISION or PROCEDURE DIVISION (other than listing all the error messages, of course).