View previous topic :: View next topic
|
Author |
Message |
beruoist
New User
Joined: 14 Nov 2007 Posts: 70 Location: mumbai
|
|
|
|
Hi,
I need to know, that is there any function by which we can know that the file is empty
Regards |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
There is no ready-made Natural function for that.
You have at least three options:
1. Use READ WORK FILE ONCE and see if there is at least one record.
2. Invoke a job that tests for file emptyness from within Natural, and check the return code.
3. Call a REXX exec (using IRXJCL) from within Natural to test for file emptyness. Set an appropriate return code on return to Natural.
O. |
|
Back to top |
|
|
beruoist
New User
Joined: 14 Nov 2007 Posts: 70 Location: mumbai
|
|
|
|
Ofer,
can you please elaborate a bit in the second point.
Thanks |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
There are many many ways, using JCL, to test if a dataset is empty. Search the forum for lots of examples.
When you have the job ready, invoke it from within Natural, using NATRJE or RPC. Then, after job has been submitted, you can either check its MAX-CC or by any other means see the results (for example, write the RC to a dataset or as an input to another Natural program).
By the way, my first suggestion would be the easiest to implement.
O. |
|
Back to top |
|
|
beruoist
New User
Joined: 14 Nov 2007 Posts: 70 Location: mumbai
|
|
|
|
Thanks Ofer |
|
Back to top |
|
|
|