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

how to invoke a batch job from online using TDQ


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
arun203

New User


Joined: 27 Mar 2007
Posts: 10
Location: bangalore

PostPosted: Tue Mar 27, 2007 3:44 pm
Reply with quote

Hi,
I want to invoke a batch job using online program using extrapartition TDQ. How to do this and what are the prerequisites required for this?
Please share a sample code if any
Thank You
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Mar 27, 2007 4:40 pm
Reply with quote

It would be much neater to use the SPOOL functionality, but I suppose that the output of a TD queue could be input to an internal reader.
As far as sample code goes, it's just RDO for the TDQ and a DD statement.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Mar 27, 2007 8:29 pm
Reply with quote

Ask your CICS system programmers to allocate the TDQ to INTRDR.

O.
Back to top
View user's profile Send private message
arun203

New User


Joined: 27 Mar 2007
Posts: 10
Location: bangalore

PostPosted: Wed Mar 28, 2007 10:38 am
Reply with quote

Hi,
I want to use an extrapartition TDQ to invoke a batch job from online program. For this i need to allocate TDQ as internal reader. Could any one tell the process of doing so?
Also what is the significance of the DD card
//IRDR DD SYSOUT=(A,INTRDR)
Where to add this DD card if required?
Back to top
View user's profile Send private message
arun203

New User


Joined: 27 Mar 2007
Posts: 10
Location: bangalore

PostPosted: Wed Mar 28, 2007 3:36 pm
Reply with quote

The program from whcih i am trying to invoke a batch job:

Code:
ID DIVISION.                                                 
 PROGRAM-ID. BATCH203.                                         
 DATA DIVISION.                                               
 WORKING-STORAGE SECTION.                                     
 01 78-TABLE-SIZE PIC 9(00) VALUE 9.                           
 01 WS-TABLE.                                                 
     05 FILLER  PIC X(80) VALUE                               
        '//G50383J  JOB ,,CLASS=A,MSGCLASS=A,NOTIFY=&SYSID  '.
     05 FILLER  PIC X(80) VALUE                               
        '//STEP1 EXEC PGM=IEFBR14                  '.         
     05  FILLER PIC X(80) VALUE                               
        '//NEWDSN DD DSN=G50383.SAMPLE.DSN.TEST,   '.         
     05  FILLER PIC X(80) VALUE                               
        '//       DISP=(NEW,CATLG),                '.         
     05  FILLER PIC X(80) VALUE                               
        '//       DCB=(LRECL=80,RECFM=FB,DSORG=PS),'.         
     05  FILLER PIC X(80) VALUE                               
        '//       SPACE=(800,(10,10)),UNIT=SYSDA   '.         
     05  FILLER PIC  X(80) VALUE                               
        '/*                                        '.         
     05  FILLER PIC  X(80) VALUE                               
        '//                                        '.         
     05  FILLER PIC X(80) VALUE                               
        '/*EOF                                     '.         
 01  FILLER REDEFINES WS-TABLE.                               
     05 WS-TABLE-LINE OCCURS 9 TIMES PIC X(80).               
 01  WS-QUEUE   VALUE 'IRDR'           PIC X(4).               
 01  WS-X                              PIC 9(2).       
 PROCEDURE DIVISION.                                   
     PERFORM A000-WRITE-PARA VARYING WS-X FROM 1 BY 1   
              UNTIL WS-X > 78-TABLE-SIZE.               
     EXEC CICS SEND FROM(WS-TABLE)                     
               ERASE                                   
     END-EXEC                                           
     EXEC CICS RETURN                                   
     END-EXEC.                                         
 A000-WRITE-PARA.                                       
     EXEC CICS WRITEQ TD                               
               QUEUE(WS-QUEUE)                         
               FROM (WS-TABLE-LINE(WS-X))               
               LENGTH(80)                               
     END-EXEC.           


I have added //INREADER DD SYSOUT=(A,INTRDR) to the CICS startup JCL. I also added a DCT entry with queue name as"IRDR" and DD name as "INREADER". The DSN, TDQ is using is of type FIXED, UNBLOCKED with recordsize 80.
After doing all this still iam not able to invoke batch job from online.What might be the problem? Could any one pls help me out ? Is the program which i have written has got any errors?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Mar 28, 2007 3:40 pm
Reply with quote

1. You are not supposed to define a TD queue. This is a job for your system guys. I hope they know how to allocate in to INTRDR.
2. The card in your example should be the output of some copy operation (for example: using IEBGENER). This means the output will be sent to the internal reader (that is - submitted as job).

O.
Back to top
View user's profile Send private message
arun203

New User


Joined: 27 Mar 2007
Posts: 10
Location: bangalore

PostPosted: Wed Mar 28, 2007 3:59 pm
Reply with quote

Is there any other way to allocate TDQ as internal reader other than adding a DD card //DDname DD SYSOUT=(A,INTRDR) to the CICS startup JCL ?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Mar 28, 2007 4:51 pm
Reply with quote

AFAIK - No, but you can always use CICS's SPOOL commands.

O.
Back to top
View user's profile Send private message
arun203

New User


Joined: 27 Mar 2007
Posts: 10
Location: bangalore

PostPosted: Wed Mar 28, 2007 4:57 pm
Reply with quote

Hi,
Thank you for the reply.But i need to invoke batch job from TDQ.
TDQ has been defined to internal reader by the sysadmin using the dd card //DDname DD SYSOUT=(A,INTRDR).
But still i am unable to invoke the job from online.
What might be the reasons for this?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Mar 28, 2007 5:41 pm
Reply with quote

Don't you have to push something through the intrdr to indicate that it should go ahead and release the job? Some eof thing?
Back to top
View user's profile Send private message
arun203

New User


Joined: 27 Mar 2007
Posts: 10
Location: bangalore

PostPosted: Wed Mar 28, 2007 5:49 pm
Reply with quote

Hi Thompson,
I am using /*EOF at the end of the JCL but still iam not able to invoke a batch job.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Mar 28, 2007 6:34 pm
Reply with quote

What about the LOG/CICS LOG? Do you see anything there?

O.
Back to top
View user's profile Send private message
arun203

New User


Joined: 27 Mar 2007
Posts: 10
Location: bangalore

PostPosted: Thu Mar 29, 2007 8:46 am
Reply with quote

This may be a basic question. How to see the CICS LOG?
Back to top
View user's profile Send private message
arun203

New User


Joined: 27 Mar 2007
Posts: 10
Location: bangalore

PostPosted: Thu Mar 29, 2007 11:43 am
Reply with quote

This are the statements that are found in CICS LOG

03/29/2007 09:37:47 CICS Signoff at netname IP403 by user G50383 is complete. 9 transactions entered with 2
errors.
DFHZC3462 I 03/29/2007 09:37:47 CICS P403 CSNE Node IP403 session terminated. ((2) Module name: DFHZCLS)
NQNAME P403,CSNE, 9:37:47,ZOS14A IP403
DFHZC5966 I 03/29/2007 09:37:47 CICS1 DELETE started for TERMINAL ( P403) (Module name: DFHBSTZ).
DFHZC6966 I 03/29/2007 09:37:47 CICS Autoinstall delete for terminal P403 with netname IP403 was successful.

I could not make head and tail of it
Any one pls help
Back to top
View user's profile Send private message
arun203

New User


Joined: 27 Mar 2007
Posts: 10
Location: bangalore

PostPosted: Fri Mar 30, 2007 10:02 am
Reply with quote

Hi,
From the CISC LOG i got that the program got terminated.
Wat might be the reasons for this to happen?
Back to top
View user's profile Send private message
shagnwrx

New User


Joined: 07 Jul 2006
Posts: 17
Location: Birmingham, AL

PostPosted: Fri Mar 30, 2007 11:52 pm
Reply with quote

Are you seeing a message like this?
"$HASP396 nnnnnnn TERMINATED" with nnnnnnn being your jobname.

If so, take a look a few lines preceding this termination message... Look for something like a JCL error regarding the job.
Back to top
View user's profile Send private message
arun203

New User


Joined: 27 Mar 2007
Posts: 10
Location: bangalore

PostPosted: Mon Apr 02, 2007 10:19 am
Reply with quote

Do we need to give LREC,RECFM,BLKSIZE along with the DD card for the Internal Reader like
//INREADER DD SYSOUT=(,INTRDR)
DCB= (LREC=80,RECFM=FB,BLKSIZE=80)
????????????????????/
Back to top
View user's profile Send private message
Pete Eagleton

New User


Joined: 14 Feb 2007
Posts: 11
Location: Chicago

PostPosted: Sat Apr 07, 2007 12:57 am
Reply with quote

Code:
EXEC CICS SPOOLOPEN OUTPUT                 
    TOKEN(WS-JES-TOKEN)                     
    USERID(WS-JES-USERID)                   
    NODE(WS-JES-NODE)                       
    CLASS(WS-JES-CLASS)                     
    NOCC                                   
    RESP(WS-JES-RESP)                       
    RESP2(WS-JES-RESP-2)                   
END-EXEC.                                   
IF WS-JES-RESP EQUAL DFHRESP(NORMAL)       
    GO TO 1000-SPOOL-WRITE.
 1000-SPOOL-WRITE.                                           
     ADD +1                      TO  WS-SUB.                 
     IF WS-SUB GREATER THAN +19,                             
         EXEC CICS SPOOLCLOSE                                 
             TOKEN(WS-JES-TOKEN)                             
             KEEP                                             
             RESP(WS-JES-RESP)                               
         END-EXEC                                             
         GO TO 1100-END-JES.                                 
     MOVE WS-JCL-CARD (WS-SUB)   TO  WS-JES-CARD.             
     EXEC CICS SPOOLWRITE                                     
         TOKEN(WS-JES-TOKEN)                                 
         FROM(WS-JES-CARD)                                   
         LINE                                                 
         RESP(WS-JES-RESP)                                   
     END-EXEC.                                               
     IF WS-JES-RESP EQUAL DFHRESP(NORMAL),                   
         GO TO 1000-SPOOL-WRITE.                             
     MOVE "ERROR ON JES WRITE"   TO  WS-JES-ERROR.           
     EXEC CICS SEND TEXT
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sat Apr 07, 2007 1:26 am
Reply with quote

arun203 wrote:
From the CISC LOG i got that the program got terminated.
Wat might be the reasons for this to happen?
How do you mean "got terminated"?
It looks like a program that you would execute at a terminal, right?
Start CEDF before you enter your tranid and insure that it follows all the commands you want.
Before this, change the DD to a direct sysout so you can "see" what is really being pushed out the TDQ.
Keep us informed....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Apr 07, 2007 1:32 am
Reply with quote

Hello,

From the initial post - this
Quote:
01 78-TABLE-SIZE PIC 9(00) VALUE 9.
is hopefully a copy/paste error. . . .?
Back to top
View user's profile Send private message
Pete Eagleton

New User


Joined: 14 Feb 2007
Posts: 11
Location: Chicago

PostPosted: Sat Apr 07, 2007 1:32 am
Reply with quote

Mr. Thompson I hate to say this but I believe that ARUN203 is just not getting it.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sat Apr 07, 2007 1:46 am
Reply with quote

That might be, but he is putting a lot into solving this, providing code rather than asking for it and seems to be on the edge of success.

I'll keep trying to help, I know Dick will also. As an aside, If you have ever taken problem calls from users (and/or operators) and had to literally direct their eyes to certain areas of the screen or logs to get them to identify and report back the information the you needed to identify and the solve their problem, then you know how difficult it can be to help.....and here we don't have the advantage of the immediate interaction of voice, we are emailing this exchange.... icon_rolleyes.gif
Back to top
View user's profile Send private message
Pete Eagleton

New User


Joined: 14 Feb 2007
Posts: 11
Location: Chicago

PostPosted: Sat Apr 07, 2007 2:03 am
Reply with quote

Thanks for the reply. I'm hoping by showing a sample piece of code for using the spool output from CICS will help him. My major background is in application development and support with a little system stuff thrown in.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Apr 07, 2007 2:04 am
Reply with quote

Hello,

And we're not likely to have one of my favorite means of providing help - directly looking into the system to see what's going on. Fortunately, the client folks i support always insist that i be able to "reach out" and touch their systems.

As Bill mentioned, it can be an adventure to work thru an "opportunity" when the dialog is between people 1/2 a world away, with different time zones and native languages, and may take multiple days. While it can be quite interesting for us to dig into, i am sure that the person looking for a solution doesn't find it as such.
Back to top
View user's profile Send private message
Pete Eagleton

New User


Joined: 14 Feb 2007
Posts: 11
Location: Chicago

PostPosted: Sat Apr 07, 2007 2:11 am
Reply with quote

Thanks! you're right it is easier when you can see directly what they're trying to do. but we can keep trying!
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 -> CICS Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Excuting store procedure via JCL batch JCL & VSAM 1
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
No new posts batch SFTP job using AOPBATCH unable ... All Other Mainframe Topics 7
No new posts Error to invoke MPP program through B... IMS DB/DC 3
Search our Forums:

Back to Top