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

Use Of Data files in Cobol Db2 Program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Amit Suri

New User


Joined: 28 Oct 2008
Posts: 25
Location: hyderabad

PostPosted: Fri Jul 02, 2010 2:37 pm
Reply with quote

Hi Everyone

I am quite new to "cobol Db2" Programming , So please dont mind if the question below is too simple to answer

So far i have been able to write normal cobol-db2 program (without using the Datafiles or Subprograms ) Compile & Execute the same

Now i have to incorporate the use of files in mine program : for the same could you please what changes i have to make in mine EXECUTE Jcl?
Should i use the DD names of the files being used by the program as it is Or do i need to make some further modification: FYR below is the Execute Jcl i have been using so far

===============
//STEP01 EXEC PGM=IKJEFT01,DYNAMNBR=20
//STEPLIB DD DSN=*.LOADLIB,DISP=SHR
// DD DSN=DSN*.SDSNLOAD,DISP=SHR
// DD DSN=DSN*.SDSNEXIT,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(*)
RUN PROGRAM(BN000001) PLAN(XBEXSFA)
END
/*
======================


Thanks!
Amit
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Fri Jul 02, 2010 2:40 pm
Reply with quote

So what happened when you tried it
Back to top
View user's profile Send private message
Amit Suri

New User


Joined: 28 Oct 2008
Posts: 25
Location: hyderabad

PostPosted: Fri Jul 02, 2010 2:44 pm
Reply with quote

Hi

I have used this jcl so far for COB-Db2 programs without having any files:

Was concerned to know if some basic changes needs to be made for the
inclusion of Datafiles in the program for the same program

Anyways i will try to use the DD names of the Files In the same jcl, will get back just in case

Thanks
Back to top
View user's profile Send private message
Amit Suri

New User


Joined: 28 Oct 2008
Posts: 25
Location: hyderabad

PostPosted: Fri Jul 02, 2010 5:58 pm
Reply with quote

I just included the DD statements in the Execute Jcl and Added One
SYSOUT DD statement to display the records : It worked :)

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

Global Moderator


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

PostPosted: Fri Jul 02, 2010 6:00 pm
Reply with quote

Excellent, it just goes to show what happens when you try it for yourself icon_biggrin.gif
And thank you for letting us know the solution in case someone else has the same question.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Fri Jul 02, 2010 6:11 pm
Reply with quote

DB2 is running as just another sub-system in the MVS address-space. Using IKJEFT01 you "create an environment" to tell the system that using my user-program (via SYSTSIN) communicate to that sub-system. Having said that and if one is working with COBOL-DB2 program, COBOL way of functioning with JCL is not disturbed - so adding DD name was the only choice one is left with when talking about using files in a COBOL-program, the traditional way.

And yes appreciate your efforts and thanks for posting the solution. icon_smile.gif
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Replace each space in cobol string wi... COBOL Programming 3
Search our Forums:

Back to Top