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

How to execute TSO commands through JCL


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
harinatha

New User


Joined: 24 Jul 2005
Posts: 28

PostPosted: Sat Jul 30, 2005 8:11 am
Reply with quote

Hi,

How to execute TSO commands through JCL
In one of interview, this question is asked.



Thanks & Regards
Hari.
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Sun Jul 31, 2005 11:59 pm
Reply with quote

Hi Hari,
You can use the IKJEFT01 prgram to execute the TSO commands through JCL.

Here is the jcl example.

//PS010 EXEC PGM=IKJEFT01
//SYSTSIN DD *
your TSO command...
/*
//SYSTSPRT DD SYSOUT=*

Thanks
Krishy
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Mon Aug 01, 2005 7:02 pm
Reply with quote

sorry guys, again same problem:
Fatal error: Call to undefined method emailer::from() in /home/ibmmainf/public_html/includes/functions_post.php on line 671
anywz here is the text:

//IBMUSERJ JOB (ACCT#),COB2TSO,
// NOTIFY=&SYSUID,
// CLASS=A,MSGCLASS=X,COND=(0,NE)
//COB2 EXEC PGM=IGYCRCTL
CBL NOLIB,APOST,NODECK,OBJECT,NOSEQ,BUF(10000),DYNAM
CBL NOMAP,NOLIST,NOOFFSET,NOXREF
******************************************************************
* *
* MODULE NAME = COB2TSO *
* *
* DESCRIPTIVE NAME = Issue TSO commands from a COBOL program. *
* *
* FUNCTION = This sample program demonstrates how to invoke *
* TSO commands from a COBOL program using *
* standard TSO services as documented in the *
* TSO/E Programming Services manual. *
* *
* Most TSO commands, including CLISTs and REXX *
* execs can be executed using this technique. *
* TSO commands which require authorization *
* (such as OUTPUT, SEND, TRANSMIT and RECEIVE) *
* will not work. *
* *
* AUTHOR = Gilbert Saint-Flour <gsf@pobox.com> *
* *
******************************************************************
Identification Division.
Program-ID. CB2TSOEV.

Data Division.
Working-Storage Section.
01 Filler.
05 ws-dummy Pic s9(8) Comp.
05 ws-return-code Pic s9(8) Comp.
05 ws-reason-code Pic s9(8) Comp.
05 ws-info-code Pic s9(8) Comp.
05 ws-cppl-address Pic s9(8) Comp.
05 ws-flags Pic X(4) Value X'00010001'.
05 ws-buffer Pic X(256).
05 ws-length Pic s9(8) Comp Value 256.

Procedure Division.
*----------------------------------------------------------------*
* Call IKJTSOEV to create the TSO/E environment *
*----------------------------------------------------------------*
CALL 'IKJTSOEV' Using ws-dummy
ws-return-code
ws-reason-code
ws-info-code
ws-cppl-address.
IF ws-return-code > zero
DISPLAY 'IKJTSOEV Failed, Return-code=' ws-return-code
' Reason-code=' ws-reason-code
'Info-code=' ws-info-code
MOVE ws-return-code to Return-code
STOP RUN.
*----------------------------------------------------------------*
* Build the TSO/E command in ws-buffer *
*----------------------------------------------------------------*

MOVE 'ALLOCATE DD(SYSPUNCH) SYSOUT HOLD' to ws-buffer.

*----------------------------------------------------------------*
* Call the TSO/E Service Routine to execute the TSO/E command *
*----------------------------------------------------------------*
CALL 'IKJEFTSR' Using ws-flags
ws-buffer
ws-length
ws-return-code
ws-reason-code
ws-dummy.
IF ws-return-code > zero
DISPLAY 'IKJEFTSR Failed, Return-code=' ws-return-code
' Reason-code=' ws-reason-code
MOVE ws-return-code to Return-code
STOP RUN.

*----------------------------------------------------------------*
* Check that the ALLOCATE command worked *
*----------------------------------------------------------------*
DISPLAY 'ALLOCATE Worked ! ' Upon Syspunch.

STOP RUN.
/*
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD UNIT=VIO,SPACE=(TRK,1)
//SYSUT2 DD UNIT=VIO,SPACE=(TRK,1)
//SYSUT3 DD UNIT=VIO,SPACE=(TRK,1)
//SYSUT4 DD UNIT=VIO,SPACE=(TRK,1)
//SYSUT5 DD UNIT=VIO,SPACE=(TRK,1)
//SYSUT6 DD UNIT=VIO,SPACE=(TRK,1)
//SYSUT7 DD UNIT=VIO,SPACE=(TRK,1)
//SYSLIN DD UNIT=VIO,SPACE=(TRK,1),DISP=(,PASS),BLKSIZE=3200
//*
//GO EXEC PGM=LOADER,PARM=NOPRINT
//SYSLIN DD DISP=(OLD,PASS),DSN=*.COB2.SYSLIN
//SYSLIB DD DISP=SHR,DSN=CEE.SCEELKED
//SYSOUT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*

Hope this helps you. Let me know if you have any concerns.
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Fetch data from programs execute (dat... DB2 3
This topic is locked: you cannot edit posts or make replies. How To Write, Compile and Execute Cob... COBOL Programming 5
No new posts Evaluate variable to execute a jcl step JCL & VSAM 3
No new posts Console Commands All Other Mainframe Topics 4
Search our Forums:

Back to Top