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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: HOW to Abort a JCL proc when a report has zero records
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: 7931
Location: Bellevue, IA

PostPosted: Thu Dec 11, 2008 9:42 pm    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Dec 11, 2008 9:45 pm    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Dec 11, 2008 11:50 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Detailed Transaction History report f... Kyle Carroll CICS 5 Tue Oct 18, 2016 12:42 am


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