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

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


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Wed Jul 07, 2010 7:49 pm
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
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

Superior Member


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

PostPosted: Wed Jul 07, 2010 8:07 pm
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

Moderator Emeritus


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

PostPosted: Wed Jul 07, 2010 9:01 pm
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: 2481
Location: Netherlands, Amstelveen

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

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
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

Moderator Emeritus


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

PostPosted: Thu Jul 08, 2010 7:52 pm
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: 8797
Location: Welsh Wales

PostPosted: Fri Jul 09, 2010 11:29 am
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: 792
Location: Pennsylvania

PostPosted: Fri Jul 09, 2010 5:52 pm
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

Moderator Emeritus


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

PostPosted: Fri Jul 09, 2010 7:45 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Search string in job at regular Spool... CLIST & REXX 0
No new posts create rexx edit Macro that edits the... CLIST & REXX 3
No new posts calling a JCl inside a JCL JCL & VSAM 3
No new posts SRCHFOR ‘string’ command inside P... TSO/ISPF 14
Search our Forums:

Back to Top