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
 

 

Use Of Data files in Cobol Db2 Program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Use Of Data files in Cobol Db2 Program
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: 8593
Location: Back in jolly old England

PostPosted: Fri Jul 02, 2010 2:40 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Use Of Data files in Cobol Db2 Program
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: 8593
Location: Back in jolly old England

PostPosted: Fri Jul 02, 2010 6:00 pm    Post subject:
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

Senior Member


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

PostPosted: Fri Jul 02, 2010 6:11 pm    Post subject:
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    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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
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
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


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