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
 
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 Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts How syntax check at Bind time is diff... Poha Eater DB2 5 Wed Mar 21, 2018 9:16 pm
No new posts Find a string in PS file opened in br... mukkas CLIST & REXX 3 Sat Feb 24, 2018 2:15 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am

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