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

HOW to Abort a JCL proc when a report has zero records


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
hsbawari
Currently Banned

New User


Joined: 16 Sep 2008
Posts: 9
Location: chennai

PostPosted: Thu Dec 11, 2008 9:33 pm
Reply with quote

I have a PROC which creates a file and populates data in it and then emails the same to different users in excel form. My first requirement is that when the file is empty it should not be sent and the proc should stop the execution.

My second requirement is that the data in the flat file is like a table and when I am getting the output file it gives me data in single column. How to get each field in a different column.

Thanks
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Dec 11, 2008 9:42 pm
Reply with quote

You could write a program to check the file for records and if none set a return code for the step; there are some utilities (not all from IBM) that can do similar things.

Do you mean the emailed shows up in Excel as a single column? If so, you probably will need to convert the data to comma delimited before sending -- which will probably require a program, so you could have one program check the file to be empty AND reformat it into .csv (comma delimited) format.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Dec 11, 2008 9:45 pm
Reply with quote

Do you have a sort product which will set a return code if the file is empty? You can then bypass (remaining) steps where the file is empty.

You don't say what the table looks like or where it is to be located. You might, for example, use the same sort product to reformat your data - you might even produce the output as comma-delimited file.

Garry.
Back to top
View user's profile Send private message
hsbawari
Currently Banned

New User


Joined: 16 Sep 2008
Posts: 9
Location: chennai

PostPosted: Thu Dec 11, 2008 9:46 pm
Reply with quote

Could you please help with a sample JCl. ACtually I used ICETOOL but I am getting the following error:

ICE630I 0 MODE IN EFFECT: STOP

* SET RC=12 IF < 0 RECORDS, ELSE RC=0 COUNT FROM(IN) LOWER(0)
$
ICE614A 0 INVALID OPERATOR
ICE602I 0 OPERATION RETURN CODE: 12




I have the file in .csv format but still I cannot get the data in different columns
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Dec 11, 2008 11:15 pm
Reply with quote

hsbawari,

you combined the comments along with the COUNT parm.

your toolin statement should be as follows

Code:

//TOOLIN   DD *                       
* SET RC=12 IF < 0 RECORDS, ELSE RC=0 
 COUNT FROM(IN) LOWER(0)               
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 Dec 11, 2008 11:50 pm
Reply with quote

Hello,

Quote:
I have a PROC which creates a file and populates data in it

Quote:
I am getting the output file it gives me data in single column. How to get each field in a different column.
When the file is created, insert a delimiter between each field (i find the tab character (x'05') to be quite useful). You would still create a fb file, it would just be a bit longer to accomodate the delimiter between each field.

This file when downloaded will easily import into excel.
Back to top
View user's profile Send private message
hsbawari
Currently Banned

New User


Joined: 16 Sep 2008
Posts: 9
Location: chennai

PostPosted: Fri Dec 12, 2008 5:21 pm
Reply with quote

Since I cannot use * in proc so I used a file to store the toolin dd

//TOOLIN DD DSN=&VS.OV.CRDFILE(OVVERIFY),DISP=SHR

contents of crdfile (OVVERIFY)

Code:

* SET RC=12 IF < 0 RECORDS, ELSE RC=0
  COUNT FROM(IN) LOWER(0)   


Please correct me
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts Need help on formatting a report DFSORT/ICETOOL 14
Search our Forums:

Back to Top