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
 

 

Can a sysin statement be coded in a instream procedure?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: Can a sysin statement be coded in a instream procedure?
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: 413
Location: Colarado, US

PostPosted: Sun Dec 11, 2005 12:08 pm    Post subject: Re: can v code sysin statement in insteram procedure?
Reply with quote

Hi tomsran,

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

http://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    Post subject: JCL CLARIFICATIONS
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    Post subject:
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: 413
Location: Colarado, US

PostPosted: Mon Dec 12, 2005 7:48 am    Post subject: Re: can v code sysin statement in insteram procedure?
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 26, 2009 8:52 pm    Post subject: Re: Can a sysin statement be coded in a instream procedure?
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    Post subject:
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    Post subject: Reply to: Can a sysin statement be coded in a instream proce
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Fri Mar 27, 2009 4:53 pm    Post subject: Reply to: Can a sysin statement be coded in a instream proce
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm


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