Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

input cards in JCL

Status
Not open for further replies.

darb5427

Programmer
May 12, 2003
14
0
0
US
Hello. I have to load a table into a cobol Mainframe job. The only problem is the information for the table is in the form of input cards on the actual jcl. How can I compile with information that won't be available at the time of the compilation ? Thank You very much

P.S. I'm completely new to Cobol (or any programming at all for that matter)

Darby
 
When you compile, you do not need any input data available. That is only necessary when you are going to execute. The compilation will only check to see that your syntax is correct. It will not execute any instructions so will not read that table or load it until you execute.
 
Thank You very much for your reply. Where I work everyone uses assembler language, so we're kinda in the dark here. Will I be able to access the cards in the table (when executing of course) by making an assignment in the file-control section like this (SELECT cardsin ASSIGN TO SYS003)
then making an assignment in my jcl like this (// ASSGN SYS003,SYSIPT). And if this will work what else will I need in regards to my table

Thanks again

darby
 
The SELECT looks okay. I would say if you're reading this file in the JCL stream, you'll have something like this in the JCL

//SYS003 DD * (the * says data follows)
data records go here

You'll open this file like any other, read in a record and move it to the next available location in the table. When all done, close the file. Now you can do the rest of the processing in your program and access the data you put in the table.
 
Thank You Lunker for your help. I haven't started coding the program at all yet, so it will be a bit before I can tell you how things went. I'm sure it will work out fine though.

Darby
 
One more thing I failed to mention, I'm on IBM VSE, not MVS. Lunker, is the statement you gave me exclusive to MVS ?
 
I work on IBM MVS system and that is the statement. Never worked on VSE system so you probably know better how to code that JCL.
 
darb -

You've got the right idea. We generally code:
Code:
SELECT CARDIN
    ASSIGN SYS004-UR-2540R-S.
[\code]
And then assign SYS004 to SYSIPT or SYSRDR as you've shown.

Regards.

Glenn
 
SELECT CARDIN
ASSIGN SYS004 "-UR-2540R-S".

Thanks for the post Glenn. I understand everything except the end that’s in quotes. I thought maybe it's one of those funky type things you see on license plates. You know like UR-2 is like you are too (my feeble brain get stuck at this point) Can you help me out?
 
Hi All,

Not being familiar w/VSE I'm wondering if you could ACCEPT the data from SYSIN, avoiding the need for a select/assign stmt, an FD, and OPEN/CLOSE stmts as we do in MVS.

You may have to terminate the data w/a card containing "end" or "whoa" or something and test for it.

I assume the data volume is not prohibative.

Regards, Jack.
 
Darb -

I can shed some light on it, but perhaps not "Gospel" :)

The UR stands for Unit Record. Unit record devices process single records (e.g. printers, readers, punches). 2540R is the device type, i.e. a 2540 card reader. Since the 2540 also included a punch station, there is a 2540P device for punched output. Other device types you might have seen include 1403 printers, 3400 series tape drives, 3350 disk drives, etc. The S simply means Sequential.

Why all this rigamarole? Well, VSE is still rooted in DOS and the original DOS didn't have device independent IO. Your programs had to build channel (I/O) programs that were appropriate to the device type being used. This was done via different DTF types (for you OS/390 guys, think DCB): DTFSD for sequential disk, DTFMT for tape, etc. COBOL needed device type information to do that. The disk/tape managers developed for VSE provided device independence by manipulating the DTFs.

Now we have LE. LE still needs to construct the proper DTF which it does at runtime, not compile time as was once the case. LE can tell if you have a tape or disk file by examining the JCL and locating the TLBL and/or DLBL statements. Since there are no TLBL or DLBL statements for unit record devices, LE can't build the proper DTF unless you've provided device information in the program. Hence the stuff after the SYS number.

That's my take on the situation. I'm sure Gary Hasler from IBM Australia could provide better information (Gary is a real LE guru). He has lots of posts on the VSE listserver (VSE-L). You can search for his posts in the Google Groups.

Jack - as for your suggestion, you could ACCEPT the data, but you run into interesting issues (around end-of-file processing for example). Also, why go to great trouble to do something in an unusual way when a few extra characters in the SELECT statement can solve the problem? Most shops that have dealt in both the OS/390 and VSE worlds are quite comfortable dealing with these issues in this way. Also, I believe the approach I've outlined does allow you to put the "control card" or table data on disk or tape.

Regards.

Glenn
 
Darb -

I did some further looking into this. If your SELECT looks like this:

SELECT INPUT-FILE ASSIGN TO SYSxxx

where SYSxxx is a programmer-defined logical unit (i.e. SYS000 - SYS254).

You can code:

// ASSGN SYSxxx,SYSIPT

in your JCL and all will be just fine.

Glenn
 
Thank You all for input. I especially want to thank you Glenn for going into such detail. It's very reassuring and comforting to know that not only are you guy’s experts, but that you’re willing to share your knowledge with a complete rookie like myself.

I also want to apologize for not supplying all the important details of my question and my work environment in the initial post. (I’m chalking that one up to being a newbie as well)

I’m still a long ways off from actual running of my job, but once I do, I’ll keep you guys posted to my progress. Thanks again Tek-Tips

Darby
 
Sorry it took me so long to get back on this. The card table is working great, here's what it looks like

INPUT-OUTPUT SECTION.
FILE-CONTROL.
*
SELECT CARDSIN ASSIGN TO SYS003.

and in the JCL

// ASSGN SYS003,SYSIPT
// EXEC PROC=TEST
// EXEC C503051,SIZE=C503051
Z6W
W7T
5E1
25E

Worked just as you suggested Glenn.

Thank You
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top