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

Process to call the control card in the program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rahul kapadia
Currently Banned

New User


Joined: 17 May 2008
Posts: 9
Location: hyderabad

PostPosted: Sun May 18, 2008 11:45 pm
Reply with quote

hi!

i have a program where we have some hardcoded employee numbers in it, we need to remove that and keep them in a contral card and call them in the program, can you please how to do it and whats the process to call the control card in the program.

thanks
rahul.


Warning: Do not use the Forum name as Topic Title. Title changed
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon May 19, 2008 12:38 am
Reply with quote

Passing values to cobol program through JCL
what is diff between PARM and SYSIN DD *
How to pass parm parameter to COBOL program
help for parameter passing
Back to top
View user's profile Send private message
rahul kapadia
Currently Banned

New User


Joined: 17 May 2008
Posts: 9
Location: hyderabad

PostPosted: Mon May 19, 2008 1:03 am
Reply with quote

im srry i didnt understand, can u please explain me a bit clearly( if possible the code ), where should have a control card, how to get values from this control card to a cobol program

thanks
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon May 19, 2008 1:16 am
Reply with quote

rahul kapadia wrote:
im srry i didnt understand, can u please explain me a bit clearly
Did you follow the links? Did you read the threads?
They all contain some good information....... Once you understand the various ways what you need can be done, you can then make a decision on how to do it....
Back to top
View user's profile Send private message
rahul kapadia
Currently Banned

New User


Joined: 17 May 2008
Posts: 9
Location: hyderabad

PostPosted: Mon May 19, 2008 1:34 am
Reply with quote

hi

thank you very much for sending me the info, i have clearly understand what u have sent, but a question stil troubles me, can you plese help me regarding this....what excatly is a control card and how are values passed from a control card to a prog, i understood how values need to be passed as per PARM and SYSIN DD*, but i have never worked with control card, can you please help me regarding this...
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon May 19, 2008 1:41 am
Reply with quote

rahul kapadia wrote:
can you plese help me regarding this....what excatly is a control card and how are values passed from a control card to a prog, i understood how values need to be passed as per PARM and SYSIN DD*, but i have never worked with control card, can you please help me regarding this...
Control card is just a more generalized term for reading 80 byte records an external dataset (from SYSIN or an actual PDS member)....
SYSIN data can be imbedded in the JCL (DD*) or have a DSN that points to a PDS member or actual flat file....
SYSIN does not have to be the filename for the data, it could be anything you want (like CONTROL or PARMCRD)...
Back to top
View user's profile Send private message
rahul kapadia
Currently Banned

New User


Joined: 17 May 2008
Posts: 9
Location: hyderabad

PostPosted: Mon May 19, 2008 1:51 am
Reply with quote

ok i have understood, can you please give a small example so that i can have a practical understanding, say i have a prog where i have emp num 6756 whose dept num is abcd hardcoded in a program, now i need to place this is a control card and read it in the prog, can you please explain this to mw, it would be very helpful

thanks
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon May 19, 2008 1:59 am
Reply with quote

You are a programmer, just write a SELECT and FD for an 80 byte input file for your data.
Put your data in an 80 byte file.
OPEN, READ & verify the data.
Use it as you wish.

Please post your code back here and we can give you feedback then.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon May 19, 2008 2:28 am
Reply with quote

Hello Rahul and welcome to the forums,

As CG suggests, post your code and we can help if there are questions/problems.

Here's a sample sysin input file with 2 employees:
Code:
//SYSIN   DD *
6756 ABCD
4368 DFRW
/*

I've shown this as "instream data" which will work well for initial testing. Your process will probably work better if the employee control info is in a member of some pds or is an individual file when promoted to production.

Someone will be here if there are questions/problems.
Back to top
View user's profile Send private message
rahul kapadia
Currently Banned

New User


Joined: 17 May 2008
Posts: 9
Location: hyderabad

PostPosted: Mon May 19, 2008 2:33 am
Reply with quote

hi d.sh.

thanks for your reply, i understood what u have sent, but i was told that we need to use a control card for each employee seperately so that in future any changes made can be made directly to the card, i am really confused big time, Please can you shown me an example as how a control card has to created and code to use that in cobol and its corresponding rqst, please can you do it for me...

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon May 19, 2008 2:52 am
Reply with quote

Hi Rahul,

Quote:
i was told that we need to use a control card for each employee seperately so that in future any changes made can be made directly to the card
Yes, this is why i mentioned using a member in some PDS. For testing, it does not matter where the data resides - the code will be the exact same. The difference will be in the DD statement that defines the "control card".

Don't let the term "control card" cause confusion. It is just a name. As it happens, it will control which employee(s) to process (without needing to re-compile the program every time this is run).

Your program will be just as it is now except the empid/dept will be read from an external file rather than referencing some "hard-coded" value. You could probably read the external file and move the empid/dept values to the fields that are now literals in the code.

You need to talk with whoever is providing the "rules" and ask if more than one employee might be processed in a single execution of this program. We (here at the forum) don't get to vote on that icon_smile.gif

If you are having confusion with the concept of reading the "control card", i'd suggest you write/clone a very tiny program to read the info from my other post and when you read a "control card" simply DISPLAY it. Once you feel comfortable reading the card(s), put that code in the "real" program.
Back to top
View user's profile Send private message
rahul kapadia
Currently Banned

New User


Joined: 17 May 2008
Posts: 9
Location: hyderabad

PostPosted: Mon May 19, 2008 3:36 am
Reply with quote

hi d.sch

now its very clear, i just want to make sure what i understood.....so we need to keep the value (empid/dept) in a pds and call the pds during run of the program, am i right, pls correct if i need to know more, please suggest me...icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon May 19, 2008 3:47 am
Reply with quote

Hello,

Quote:
call the pds during run of the program
Well, if you mean coding a SELECT, FD, OPEN, READ, CLOSE as "calling the pds", yes. What i gave is the DD statement needed in the execute jcl. You need to add the pieces to the COBOL code.

I'll be online off and on for the next several hours, so when you have some code and try it, let me know what happens. Keep in mind that your new FD simply replaces the constants in the original code.
Back to top
View user's profile Send private message
rahul kapadia
Currently Banned

New User


Joined: 17 May 2008
Posts: 9
Location: hyderabad

PostPosted: Mon May 19, 2008 3:58 am
Reply with quote

Hi,

I want to know how to create a control card with an employee number 678, and how this would be read in a cobol prog and its corresponding jcl...can you please give a sample logic so that i could get an idea and work it on real time...

Thanks,
Rahul.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon May 19, 2008 5:25 am
Reply with quote

Hi Rahul,

Quote:
coding a SELECT, FD, OPEN, READ, CLOSE
is the logic. . .

You have code with one or more SELECT statements? Add another.

Your code has one or more FDs? Add another.

You code OPENs some file(s). Include another.

The same with a READ. . .

As i suggested before, do this in a separate program if you need to. Once you have the code, you can post questions about it here.

Quote:
I want to know how to create a control card with an employee number 678
Look above. There are 2 samples in the SYSIN i posted earlier. If you only want one, ignore the other.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon May 19, 2008 7:38 pm
Reply with quote

Hello Rahul,

Is progress being made?

Hopefully, your code is working as you need now.

If there are still questions, post what you have so far and your question(s) about it.
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 Using API Gateway from CICS program CICS 0
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
Search our Forums:

Back to Top