Page 1 of 1

HELP!! abendu4038 ERROR

PostPosted: Wed Feb 24, 2010 10:14 am
by woaiwanchan
In my cobol code when i use 'accept' keyword then the jcl return abendu4038.
What's the reason?

Thank advance

Re: HELP!! abendu4038 ERROR

PostPosted: Wed Feb 24, 2010 10:17 am
by woaiwanchan
MY cobol code is
   ACCEPT A.
            ACEEPT B.
           ADD A TO B.
           DISPLAY B         

If i don't use the 'accept' keyword the programe run all right.

Re: HELP!! abendu4038 ERROR

PostPosted: Wed Feb 24, 2010 10:35 am
by dick scherrer
Hello and welcome to the forum,

You have not provided enough for someone to use to help you. . . Also, there is diagnostic information available that you have not shown.

The posted code could not compile, so for someone to help, you need to post the actual code. Do not key codeinto a topic - use copy/pasteto preventtypo's. Then use the Code tag to preserve alignment and improve readability.

How are A and B defined? What is the jcl and input data ?

Re: HELP!! abendu4038 ERROR

PostPosted: Wed Feb 24, 2010 10:55 am
by woaiwanchan
This is my cobol code
IDENTIFICATION DIVISION.
         PROGRAM-ID. ADDNUM.
         ENVIRONMENT DIVISION.
         WORKING-STORAGE SECTION.
         01 A PIC 9(10).
         01 B PIC 9(10).
         01 C PIC 9(10).
         PROCEDURE DIVISION.
                ACCEPT A.
                ACCEPT B.
        *      MOVE 3 TO A.    (if use this that would be success)
        *      MOVR 4 TO B.
                ADD A,B GIVING C.
                DISPLAY A " ADD " B '=' C.
                 STOP RUN.


jcl
 //JOBADD      JOB ,LEROY,CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=EXT2231
 // STEP1        EXEC  PGM=ADD,RESION=128M
//STEPLIB       DD  DSN=EXT2231.MY.COBOL.LOAD,DISP=SHR
//SYSPRINT     DD SYSOUT=*
//

Re: HELP!! abendu4038 ERROR

PostPosted: Wed Feb 24, 2010 11:04 am
by woaiwanchan
Image

Re: HELP!! abendu4038 ERROR

PostPosted: Wed Feb 24, 2010 11:16 am
by dick scherrer
Hello,

There is no "input" for the ACCEPTs. This causes the abend.

When you move literals, the ACCEPT is not executed and there is no abend.

To use your code with the ACCEPTs, you need to include a //SYSIN DD * with the next 2 statements containing a 10-digit number.

Keep in mind that in "real" applications, ACCEPT is nearly never permitted, but is ok for a training exercise.

Re: HELP!! abendu4038 ERROR

PostPosted: Wed Feb 24, 2010 11:31 am
by woaiwanchan
Very thanks

Where are you from? I come from china .now i'm only a intern and i will try hard like you(dick scherrer )

Re: HELP!! abendu4038 ERROR

PostPosted: Thu Feb 25, 2010 1:08 am
by dick scherrer
You're welcome :)

I'm from the US.

now i'm only a intern
We all were beginners at one time. . .

d

Re: HELP!! abendu4038 ERROR

PostPosted: Thu Feb 25, 2010 1:10 am
by Robert Sample
dick scherrer wrote:We all were beginners at one time. . .

d
Cue up the music ...


A long, long time ago in a galaxy far, far away ....

:D

Re: HELP!! abendu4038 ERROR

PostPosted: Thu Feb 25, 2010 1:49 am
by dick scherrer
A long, long time ago in a galaxy far, far away ....
When you saw this scroll up the movie screen in 1977 or there about, did it remind you of something from much earlier . . .?

d