Use of AS in ESDS



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Use of AS in ESDS

Postby gowthamgyaa » Wed Oct 24, 2012 12:36 pm

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
gowthamgyaa
 
Posts: 101
Joined: Wed Sep 05, 2012 11:18 pm
Has thanked: 67 times
Been thanked: 0 time

Re: Use of AS in ESDS

 

Re: Use of AS in ESDS

Postby BillyBoyo » Wed Oct 24, 2012 12:46 pm

What do the manuals tell you about it? Have you tried removing "AS-"?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Use of AS in ESDS

Postby gowthamgyaa » Wed Oct 24, 2012 1:11 pm

Hi,
I Removed AS and wrote a code it shows an abend sco4.


Kind regards
gyaa
gowthamgyaa
 
Posts: 101
Joined: Wed Sep 05, 2012 11:18 pm
Has thanked: 67 times
Been thanked: 0 time

Re: Use of AS in ESDS

Postby BillyBoyo » Wed Oct 24, 2012 1:51 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Use of AS in ESDS

Postby Robert Sample » Wed Oct 24, 2012 2:21 pm

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.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Use of AS in ESDS

Postby Robert Sample » Wed Oct 24, 2012 5:00 pm

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).
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post