Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

can i use TSO command in Cobol program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
mbr_raja

New User


Joined: 15 Nov 2004
Posts: 26
Location: Chennai, India

PostPosted: Wed Jun 01, 2005 6:14 pm    Post subject: can i use TSO command in Cobol program
Reply with quote

If it used, please tell me how to invoke in the cobol program
Back to top
View user's profile Send private message

kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Wed Jun 01, 2005 7:54 pm    Post subject:
Reply with quote

yes it can be...this question is answered in this forum, but couldn't remebr where...i m just sending you the code for the same which i have taken from this forum only.
icon_idea.gif If any one has idea please give the link.

The code is:
//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 help you...[/list]
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us