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
 

 

Any syntax to find an empty workfile in natural ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
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    Post subject: Any syntax to find an empty workfile in natural ?
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: 2360
Location: Israel

PostPosted: Wed Sep 17, 2008 11:08 am    Post subject:
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    Post subject: Reply to: Any syntax to find an empty workfile in natural ?
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: 2360
Location: Israel

PostPosted: Thu Sep 18, 2008 12:39 am    Post subject:
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    Post subject: Reply to: Any syntax to find an empty workfile in natural ?
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    IBMMAINFRAMES.com Support Forums -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
This topic is locked: you cannot edit posts or make replies. Natural ADABAS Opening with CTS enikhilk Mainframe Jobs 0 Wed Nov 30, 2016 5:37 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm


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