View previous topic :: View next topic
|
Author |
Message |
tomrsan
New User
Joined: 15 Oct 2005 Posts: 13 Location: chennai
|
|
|
|
1) Can a sysin statement be coded in instream procedure?
2) If a procedure uses a cobol program, how can I give some data to the cobol program?
3) How to run a job for cobol-db2 program? |
|
Back to top |
|
|
iknow
Active User
Joined: 22 Aug 2005 Posts: 411 Location: Colarado, US
|
|
Back to top |
|
|
appanna babu
New User
Joined: 11 Dec 2005 Posts: 4 Location: hyderabad
|
|
|
|
MY ANSWERS TO U R QTN'S
1) NO WE CAN'T USE SYSIN IN INSTREAM PROCEDURE.
2) WE CAN PASS THE VALUES TO COBOL PROGRAM FROM JCL BY SPECIFYING THE REQUIRED VALUES AFTER THE "SYSIN DD *".
3) WE CAN RUN A JCL FOR A COBOL PROGRAM BYREFERRING THE 'PROC FUNCTION TO IGYWCLG AND BY DEFINING THE COBOL NAME IN //COBOL.SYSIN DD DSN=COBOL.PDS(MEM),DISP=SHR[/size]. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
You can do something like this:
Code: |
//proc1 proc
//s1 exec pgm=pgma
//sysin dd mysysin
// pend
//*
// exec proc1
//s1.mysysin dd *
a
b
c
etc.
/* |
Sorry. The code above s/b:
Code: |
//proc1 proc
//s1 exec pgm=pgma
//sysin dd ddname=mysysin
// pend
//*
// exec proc1
//s1.mysysin dd *
a
b
c
etc.
/* |
|
|
Back to top |
|
|
iknow
Active User
Joined: 22 Aug 2005 Posts: 411 Location: Colarado, US
|
|
|
|
Hi tomsran,
As a follow up to the above posts, I am just adding some more points for your queries.
Quote: |
1) in jcl can v code sysin in instream procedure? |
You cannot code instream data in a PROC.In order to overcome this limitation,one way is to code SYSIN DD DUMMY in the PROC, and then override this from the JCL with instream data.
Quote: |
3) how can i run jcl for cobol-db2 prgram |
To run a COBOL batch program from JCL use this notation(To run a non DB2 program),
Code: |
//STEP001 EXEC PGM=MYPROG |
To run a DB2 program,
Code: |
//STEP001 EXEC PGM=IKJEFT01
//SYSTSIN DD *
DSN SYSTEM(....)
RUN PROGRAM(MYPROG)
PLAN(.....) LIB(....) PARMS(...)
/* |
Hope this helps. |
|
Back to top |
|
|
Jef
New User
Joined: 23 Mar 2009 Posts: 2 Location: Switzerland
|
|
|
|
mmwife wrote: |
You can do something like this:
Code: |
//proc1 proc
//s1 exec pgm=pgma
//sysin dd mysysin
// pend
//*
// exec proc1
//s1.mysysin dd *
a
b
c
etc.
/* |
|
Hi all,
It seems the above sample didn't work properly with cataloged procedures (I got a JCL error without any other explanation).
Is it possible that it only works with instream procedures, and not with cataloged ones?
My problem is that some parameters in a SYSIN DD * from the base JCL should be given as file-input in the proc.(?)
Best regards,
Jef |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
See Chapter 5 of the MVS JCL Reference for proper PROCedure syntax, both instream and cataloged. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
tomrsan wrote: |
1) Can a sysin statement be coded in instream procedure?
2) If a procedure uses a cobol program, how can I give some data to the cobol program?
3) How to run a job for cobol-db2 program? |
1) YES if reading a dataset.
//SYSIN DD DSN=xxx.yyy(member),DISP=SHR is perfectly valid
However, SYSIN DD * can not be coded as part of a proc. |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
3) How to run a job for cobol-db2 program?
It depends on how the COBOL DB2 program is linked.
If it is linked to use CAF or the newer replacement for it:
//STEP001 EXEC PGM=MYPROG
(you may need other dds to give the System, SubSystem, Package/Plan...)
Otherwise you may need to use IKJEFT01 (TSO batch) or other programs to call/Run your program as stated by others. |
|
Back to top |
|
|
Jef
New User
Joined: 23 Mar 2009 Posts: 2 Location: Switzerland
|
|
|
|
Done! the "//sysin dd mysysin " as mentioned in the above sample must not be given in the proc. The reference in the base job is enough.
Thanks and Regards,
Jef |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
sysin is a ddname like any other one
so it' s a perfectly legal ddname to be used inside a procedure ( inline or not )
what is not allowed inside any procedure is inline data ( DDNAM2 construct up to the /* )
Code: |
//proc PROC
//G EXEC PGM=progname
//ddnam1 DD disp=...,....
//DDNAM2 DD *
inline data
inline data
/*
// PEND
|
the interviewer was playing a dirty trick on the candidate
usually sysin is associated ( mentally ) to //SYSIN DD * |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Sorry folks. The stmt in my post above s/b:
//sysin dd ddname=mysysin
not
//sysin dd mysysin
I corrected the orig post. Better late than never. |
|
Back to top |
|
|
|