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

Calling an IMS subroutine


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rexzone1

New User


Joined: 16 Dec 2006
Posts: 14
Location: Halifax, Canada

PostPosted: Mon Dec 18, 2006 10:14 pm
Reply with quote

Hi,

I am using a Driver program which calls an IMS subroutine.
What do I need to do in my program other than IO-PCB?
Please suggest.

Regards,
Ravi..
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Tue Dec 19, 2006 3:17 pm
Reply with quote

Everything the subroutine needs to operate correctly. We lack information to give you a proper answer. Please provide us with the functions of the subroutine.
Back to top
View user's profile Send private message
rexzone1

New User


Joined: 16 Dec 2006
Posts: 14
Location: Halifax, Canada

PostPosted: Sun Dec 24, 2006 11:42 pm
Reply with quote

The subroutine is accessing the IMS databases to retrieve the information and my program calls the subroutine whenever my input file has the record which satisfies my processing logic to call the subroutine. When I am making a call to the subroutine, I am passing the values to be checked to the subroutine, the subroutine goes and searches the database, then returnes with the completion code back to my program. Is it enough or you need some other information?
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Wed Dec 27, 2006 7:40 pm
Reply with quote

Hi Ravi,

This will do. Your mainprogram should call the subroutine supplying just the values to be checked, the returncodefield and the DB-PCB of the database the subroutine accesses. No IO-PCB required if no messages are sent/read by the subroutine. Sometime earlier a similar topic occurred.

Sorry for the late answer: got some days off.
Back to top
View user's profile Send private message
rexzone1

New User


Joined: 16 Dec 2006
Posts: 14
Location: Halifax, Canada

PostPosted: Thu Dec 28, 2006 5:22 am
Reply with quote

No probs sir. Thanks for the inputs. Means I just need to pass the values I want to be checked to the subroutine and subroutine will do its processing and provide me the values back in my Linkage Area, correct?
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Dec 28, 2006 3:01 pm
Reply with quote

I will give an example. My language is PL1 but I'll try some kind of COBOL for your sake icon_wink.gif

MAINPROGRAM:
PROCEDURE DIVISION USING IO-PCB, DB-PCB.
MOVE 'VALUE TO BE CHECKED' TO VAR.
MOVE SPACE TO RETURN-CODE.
CALL SUBROUTINE USING VAR, RETURN-CODE, DB-PCB.
IF RETURN-CODE = 'OK'
DISPLAY 'WE DID WELL'
ELSE
DISPLAY 'WE DID WRONG'.

SUBROUTINE:
PROCEDURE DIVISION USING VAR, RETURN-CODE, DB-PCB.
MOVE VAR TO SSA.
CALL CBLTDLI USING 4, GU, DB-PCB, IO-AREA, SSA.
CHECK THE IO-AREA.
IF ALL IS RIGHT
MOVE 'OK' TO RETURN-CODE.
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 -> IMS DB/DC

 


Similar Topics
Topic Forum Replies
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Calling an Open C library function in... CICS 1
No new posts calling a JCl inside a JCL JCL & VSAM 3
No new posts Calling IEHPROGM from REXX CLIST & REXX 7
Search our Forums:

Back to Top