View previous topic :: View next topic
|
Author |
Message |
hsbawari Currently Banned New User
Joined: 16 Sep 2008 Posts: 9 Location: chennai
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
hsbawari Currently Banned New User
Joined: 16 Sep 2008 Posts: 9 Location: chennai
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
hsbawari Currently Banned New User
Joined: 16 Sep 2008 Posts: 9 Location: chennai
|
|
|
|
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 |
|
|
|