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
 

 

create a log in the spool(SYSOUT),inside PROC

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Bahugun

New User


Joined: 07 Jul 2010
Posts: 24
Location: hyderabad

PostPosted: Wed Jul 07, 2010 7:46 pm    Post subject: create a log in the spool(SYSOUT),inside PROC
Reply with quote

I have a job which validates a file. A PROC in the job validates whether the file is empty or not. If the file is empty it gives the RC=4 else it gives the return code as RC=0. I want to create a log in the spool(SYSOUT), when the input file is empty. How it can be acheived?
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Jul 07, 2010 7:49 pm    Post subject: Reply to: create a log in the spool(SYSOUT),inside PROC
Reply with quote

Use a COBOL program to DISPLAY UPON CONSOLE your desired text message, or use a WTO (Write To Operator) macro.
Back to top
View user's profile Send private message
Bahugun

New User


Joined: 07 Jul 2010
Posts: 24
Location: hyderabad

PostPosted: Wed Jul 07, 2010 8:03 pm    Post subject: create a log in the spool(SYSOUT),inside PROC
Reply with quote

i do not want the cobol code to be changed.i need some process which can be used in jcl/PROC itself,& send the message to the spool.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Jul 07, 2010 8:07 pm    Post subject:
Reply with quote

But in any case (COBOL code or some utility) you would need to alter the PROC/JCL?
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Wed Jul 07, 2010 9:01 pm    Post subject:
Reply with quote

Hello,

What utility is being used to generate the rc=0 or rc=4?

You might consider writing the utility output to the spool. . .
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Wed Jul 07, 2010 9:22 pm    Post subject:
Reply with quote

http://ibmmainframes.com/viewtopic.php?t=48992&highlight=iebgener
Back to top
View user's profile Send private message
Bahugun

New User


Joined: 07 Jul 2010
Posts: 24
Location: hyderabad

PostPosted: Thu Jul 08, 2010 3:51 pm    Post subject: issue solved
Reply with quote

thanks for the help.the following coding helped me solve the issue.

// IF (STEP048.RC EQ 4) THEN
//STEP65 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSUT1 DD DSN=TSUE76Z.MMC.SC2JULY.JCLPARM(EMPTY),DISP=SHR
//SYSUT2 DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
// ENDIF

//*the parameter EMPTY has the string "file is
//*empty"

this can be used in proc.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Thu Jul 08, 2010 7:52 pm    Post subject: Reply to: create a log in the spool(SYSOUT),inside PROC
Reply with quote

Good to hear you have a solution - thank you for posting it icon_smile.gif

d
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: Fri Jul 09, 2010 11:29 am    Post subject:
Reply with quote

Can I ask why it is so important to display this in the spool.

Surely if you used IDCAMS as the tool to see if a dataset (a) exists and / or (b) if it is populated then all of the results would be displayed in the SYSPRINT of the IDCAMS step and be clearly visible to all and sundry.

All so easy and controllable.
If the dataset exists and is populated the RC will be 0.
If the dataset exists and is empty we get RC = 4.
If the dataset does not exist then RC = 8.
Code:
//SYSIN    DD *                                           
  LISTCAT ENT('MY DATASET NAME')                           
  IF MAXCC EQ 0 THEN PRINT IDS('MY DATASET NAME') COUNT(1)
     ELSE SET MAXCC EQ 8

Call me old fashioned but I can never remember having to go through all of this circus act with dataset exists, dataset is populated rubbish. Everything was dealt with by the program and JCL to ensure that all datasets did exist and if they were empty then the program dealt with it.

Just can not understand why programs and JCL can not work together like they did in the good old days when things were done properly.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Fri Jul 09, 2010 5:52 pm    Post subject:
Reply with quote

Expat,

I am old fashioned as well. I always write my programs to handle empty input files.

But in many of our cases we still check for data existence and alter JCL flow accordingly.

The reason is:

1) If there is data, we backup the file to a gdg. We would not want to do that for empty files because 7 out of ten would be empty (for example). Empty gens would push populated gens off too soon. Going back to find actual data would be more difficult.

2) After the program is run , emails and transmissions are sent. We do not want to send either if there was no data to process.

So you see, one simple existence check can save much unneeded processing.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Jul 09, 2010 7:45 pm    Post subject: Reply to: create a log in the spool(SYSOUT),inside PROC
Reply with quote

Hi Expat,

Quote:
Just can not understand why programs and JCL can not work together like they did in the good old days when things were done properly.
Because more and more of the people being hired do not have proper training let alone qualified mentors.

d
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am
No new posts Need to create file with Dynamic Name... kapil27 JCL & VSAM 4 Wed May 25, 2016 9:45 am


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