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

Any syntax to find an empty workfile in natural ?


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
beruoist

New User


Joined: 14 Nov 2007
Posts: 70
Location: mumbai

PostPosted: Wed Sep 17, 2008 11:01 am
Reply with quote

Hi,

I need to know, that is there any function by which we can know that the file is empty

Regards
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Sep 17, 2008 11:08 am
Reply with quote

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
View user's profile Send private message
beruoist

New User


Joined: 14 Nov 2007
Posts: 70
Location: mumbai

PostPosted: Wed Sep 17, 2008 11:18 am
Reply with quote

Ofer,

can you please elaborate a bit in the second point.

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

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Sep 18, 2008 12:39 am
Reply with quote

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
View user's profile Send private message
beruoist

New User


Joined: 14 Nov 2007
Posts: 70
Location: mumbai

PostPosted: Thu Sep 18, 2008 4:44 pm
Reply with quote

Thanks Ofer
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 -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
No new posts EMPTY file check scenario JCL & VSAM 6
Search our Forums:

Back to Top