Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8279
Location: Dubuque, Iowa, USA

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

Senior Member


Joined: 08 May 2006
Posts: 1005
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 Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Undefined Report Program socker_dad COBOL Programming 2 Fri Mar 30, 2018 1:45 am
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us