IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Loop in a program


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
beto981

New User


Joined: 06 Oct 2006
Posts: 24

PostPosted: Fri Aug 06, 2010 11:44 pm
Reply with quote

I have an execution with a program running without an input file, just like this:

Code:

//PASO010  EXEC PGM=IKJEFT01,DYNAMNBR=20                                     
//STEPLIB  DD  DSN=XXX.SDSNEXIT,DISP=SHR                     
//INPUT     DD  DUMMY                                           
//OUTPUT  DD  DSN=XXXXXXXXXXXXXXXX,, 
//             DISP=(NEW,CATLG,DELETE),SPACE=XXXXXXXX),                           
//             DCB=(DSORG=PS,BLKSIZE=XX,LRECL=XX,RECFM=FB)


And I've got an error reading (Abend Code 47) the input file.

Inserting the flollowing lines in the code, the execution was ok:

Code:

//PASO010  EXEC PGM=IKJEFT01,DYNAMNBR=20                                     
//STEPLIB  DD  DSN=XXX.SDSNEXIT,DISP=SHR                     
//INPUT     DD  DUMMY                                           
//* INPUT  DD  DSN=XXXXXXXXXXXXX,               --> LINE INSERTED
//*            DISP=SHR                         --> LINE INSERTED
//OUTPUT  DD  DSN=XXXXXXXXXXXXXXXX,, 
//             DISP=(NEW,CATLG,DELETE),SPACE=XXXXXXXX),                           
//             DCB=(DSORG=PS,BLKSIZE=XX,LRECL=XX,RECFM=FB)


Does anyone knows why this happened?

Tks!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Aug 06, 2010 11:49 pm
Reply with quote

You need to post the expanded JCL from the job listing to give us more information.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Sat Aug 07, 2010 9:34 am
Reply with quote

why the double comma?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat Aug 07, 2010 11:11 am
Reply with quote

Phrzby Phil wrote:
why the double comma?
Yeah, that's a nailed on JCL error.

Phil, maybe he's a commakhazi JCL writer icon_biggrin.gif
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Sat Aug 07, 2010 2:09 pm
Reply with quote

Hi Beto,

Quote from the Manuals for FileStatus 47
Code:
The execution of a READ statement was attempted on a file not open in the input or I-O mode.
Look into this to correct your program error ...


but yeah... you were not asking for this ..
Quote:
Inserting the following lines in the code, the execution was ok:
Does anyone knows why this happened?
Just to be sure ... You put the two commented lines and maintained the DUMMY statement ?? icon_rolleyes.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Aug 07, 2010 2:32 pm
Reply with quote

I wonder if the TS checked the File-Status after the open,
or even if he has a file status clause?

plus, as Binop has suggested, we are, as usual, only being provided info
that the TS thinks is germane to the topic.

as Robert said, unless we can see the full expansion of the JCL and the
messages pertaining to allocation of the INPUT ds as well as messages
generated during the program execution,
we can only conclude
the TS has miss-interpreted the error and has not provided enough info

and of course we have the small problem of the subject:
Loop in a program
what is that nonsense?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Aug 09, 2010 2:49 pm
Reply with quote

I agree with Dick I, too, don't understand the subject line. Also, the given JCL is executing IKJEFT01, TSO in batch, with some input/output and nothing else - why in the heaven someone will get a file-status code without a COBOL READ (which is not shown as if it was the case and if not shown, I don't assume anything)?
Back to top
View user's profile Send private message
ravidhiman

New User


Joined: 09 Oct 2006
Posts: 23
Location: London, UK

PostPosted: Mon Aug 09, 2010 3:24 pm
Reply with quote

If you are using cobol program in this step and want to use the dd dummy as input then you need to provide DCB parameters with DD dummy statment. For example :

//FILE2 DD DUMMY,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS)

The JCL will end with abend if you won't give DCB parameters. Try with DCB parametars and let me know the result.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Aug 09, 2010 3:32 pm
Reply with quote

ravidhiman wrote:
...you need to provide DCB parameters with DD dummy statment.
.
.
The JCL with abended if you won't give DCB parameters.
It depends on the pgm that uses the file. Some IBM Utilities require it. I don't recall which ones, however. But you can test without the DCB. If the pgm fails with a msg pointing to the DUMMY file, you'll know.
Back to top
View user's profile Send private message
beto981

New User


Joined: 06 Oct 2006
Posts: 24

PostPosted: Tue Aug 10, 2010 12:58 am
Reply with quote

Hi guys,
First of all, sorry for my english... this could cause a mess in the post.

And I thought I had posted the code as request, but I'm seeing that's not here. I'm sending it again:

Code:

//PASO010  EXEC PGM=IKJEFT01,DYNAMNBR=20
//STEPLIB  DD  DSN=XXXX.SDSNEXIT,DISP=SHR
//         DD  DSN=XXXX.SDSNLOAD,DISP=SHR
//INPUT DD  DUMMY
//OUTPUT  DD  DSN=XXXXXXXXXX,
//             DISP=(NEW,CATLG,DELETE),
//             SPACE=(TRK,(X,X),RLSE),
//             DCB=(DSORG=PS,BLKSIZE=X,LRECL=X,RECFM=FB)
//SYSTSPRT DD  SYSOUT=*
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//AMSDUMP  DD  SYSOUT=*
//SYSUDUMP DD  DUMMY
//SYSIN    DD  DUMMY
//SYSTSIN  DD  *
 DSN S(%%DB2)
 RUN PROG(XXXXXXX) -
 PLAN(%%PLAN) -
 END
/


The error:

Code:

** ERROR **
  USER         :ABCD
  PROCESS      :ACBD
  STEP         :210-READ-INPUT
  CODE         :10002
  FILE         :INPUT
  ADIT. CODE   :47
  SEVERITY     :08
  TYPE         :A


And I said "Loop" in the subject just because these error lines appear hundreds of times in the sysout. As the input file is DUMMY, I assumed that is a loop case.

To Phrzby Phil and expat: the double comma was my mistake when writing the post.

To Binop B: yes, I put the two commented lines and maintained the DUMMY statement .

Tks!
Back to top
View user's profile Send private message
beto981

New User


Joined: 06 Oct 2006
Posts: 24

PostPosted: Tue Aug 10, 2010 1:03 am
Reply with quote

The code that performed normally:

Code:

//PASO010  EXEC PGM=IKJEFT01,DYNAMNBR=20
//STEPLIB  DD  DSN=XXXX.SDSNEXIT,DISP=SHR
//         DD  DSN=XXXX.SDSNLOAD,DISP=SHR
//INPUT    DD  DUMMY
//* INPUT  DD  DSN=XXXXXXXXXXXXXX,
//*            DISP=SHR
//OUTPUT   DD  DSN=XXXXXXXXXX,
//             DISP=(NEW,CATLG,DELETE),
//             SPACE=(TRK,(X,X),RLSE),
//             DCB=(DSORG=PS,BLKSIZE=X,LRECL=X,RECFM=FB)
//SYSTSPRT DD  SYSOUT=*
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//AMSDUMP  DD  SYSOUT=*
//SYSUDUMP DD  DUMMY
//SYSIN    DD  DUMMY
//SYSTSIN  DD  *
 DSN S(%%DB2)
 RUN PROG(XXXXXXX) -
 PLAN(%%PLAN) -
 END
/
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Aug 10, 2010 1:07 am
Reply with quote

Hello,

What is the program attempting to do? What code causes the error to happen the first time?

Why/how might this be a jcl problem?

What are the directions for running this program?
Back to top
View user's profile Send private message
beto981

New User


Joined: 06 Oct 2006
Posts: 24

PostPosted: Tue Aug 10, 2010 1:22 am
Reply with quote

What is the program attempting to do?
The same JCL is used for more than 1 application. In my case, I don't use it for nothing, that's why the DUMMY in the input file.

What code causes the error to happen the first time?
S222. After playing hundreds of times the error messages above

Why/how might this be a jcl problem?
I don't know. I just received guidance to introduce the 2 commented line in the code, but even that person who gave me guidance doesn't know to explain why this. And it worked....
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Aug 10, 2010 1:27 am
Reply with quote

beto981 wrote:
What is the program attempting to do?
The same JCL is used for more than 1 application. In my case, I don't use it for nothing, that's why the DUMMY in the input file.


Then why are you running it?
Back to top
View user's profile Send private message
beto981

New User


Joined: 06 Oct 2006
Posts: 24

PostPosted: Tue Aug 10, 2010 1:32 am
Reply with quote

Because it's in a sequence of JCLs that I can't change. It would be far easier to run a IEFBR14... but I have to execute this!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Aug 10, 2010 2:42 am
Reply with quote

I would say either leave it running with the two lines commented out (and who knows why that works), or try with
Code:
//INPUT DD DUMMY,DSORG=PS,RECFM=??,LRECL=???,BLKSIZE=0
to see if the 47 goes away.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Aug 10, 2010 2:46 am
Reply with quote

Hello,

Quote:
RUN PROG(XXXXXXX)
Look at the code for this particular program and see what functionality is in the code. Then you will know why the DD statement is needed. . .
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Tue Aug 10, 2010 3:52 pm
Reply with quote

Hi Sir !

You have to have a closer look in this Programm. Because it runs under DB2 and Input is defined as Dummy, I assume the programm reads input from a DB2-Table and not from a file.

These hundreds of error messages could be a result of a Select or Fetch.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
This topic is locked: you cannot edit posts or make replies. REXX - Do - Not able to LOOP CLIST & REXX 10
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top