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

Can a sysin statement be coded in a instream procedure?


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
tomrsan

New User


Joined: 15 Oct 2005
Posts: 13
Location: chennai

PostPosted: Sat Dec 10, 2005 5:35 pm
Reply with quote

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
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 411
Location: Colarado, US

PostPosted: Sun Dec 11, 2005 12:08 pm
Reply with quote

Hi tomsran,

For your queries 1) and 2) please check this link for more information.

www.simotime.com/cblpar01.htm


Hope this helps.
Back to top
View user's profile Send private message
appanna babu

New User


Joined: 11 Dec 2005
Posts: 4
Location: hyderabad

PostPosted: Mon Dec 12, 2005 12:14 am
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Dec 12, 2005 4:40 am
Reply with quote

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
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 411
Location: Colarado, US

PostPosted: Mon Dec 12, 2005 7:48 am
Reply with quote

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
View user's profile Send private message
Jef

New User


Joined: 23 Mar 2009
Posts: 2
Location: Switzerland

PostPosted: Thu Mar 26, 2009 8:31 pm
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Mar 26, 2009 8:47 pm
Reply with quote

See Chapter 5 of the MVS JCL Reference for proper PROCedure syntax, both instream and cataloged.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Mar 26, 2009 8:52 pm
Reply with quote

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
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Thu Mar 26, 2009 10:18 pm
Reply with quote

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
View user's profile Send private message
Jef

New User


Joined: 23 Mar 2009
Posts: 2
Location: Switzerland

PostPosted: Fri Mar 27, 2009 4:18 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Mar 27, 2009 4:53 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Mar 28, 2009 5:24 pm
Reply with quote

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. 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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts Can EATTR be coded in an IMS COBOL pgm? IMS DB/DC 1
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts Generate output lines (SYSIN card for... DFSORT/ICETOOL 4
No new posts Invoke stored procedure via batch JCL. DB2 2
Search our Forums:

Back to Top