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

REXX - Dataset checking in a do forever loop


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
@shim

New User


Joined: 28 Oct 2021
Posts: 10
Location: India

PostPosted: Tue Mar 29, 2022 11:06 am
Reply with quote

I have a requirement which I am implementing in REXX. But not sure if that's the good approach or it has effect on performance. If you could share your views that would be helpful.

Some external systems puts the data in mainframe with a specific dataset name pattern. It is not scheduled and they can create the file anytime (in a business day they can send more than 20 times). And they want us to be processed immediately not at an scheduled interval.

I am checking through LISTCAT with a DO FOREVER loop to identify the datasets and do the subsequent processing and finally deleting it in the REXX exec.

My question is i am doing this under forever loop and without any sleep/wait. The code continuously apply LISTCAT to check for any new datasets. My understanding is that it will have impacts in terms of performance. Is there any better way to achieve this which can be implemented in REXX. Any advice on this is appreciated. Thanks in advance !!
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1335
Location: Bamberg, Germany

PostPosted: Tue Mar 29, 2022 11:09 am
Reply with quote

Consider using a dataset trigger in the Job Scheduler and let the EXEC run when that trigger is activated once new datasets are created.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Tue Mar 29, 2022 2:40 pm
Reply with quote

As trigger like stated above is the best solution. Failing that, you can certainly use a REXX pgm, but I don't believe that they really need immediate process, just within a reasonable time.
REXX unfortunately does not have a built-in WAIT function, but you can use the USS SLEEP function instead, like:
Code:
 call syscalls 'ON'         
 do forever                 
   ..check for dataset..     
   address syscall 'sleep 10'
 end

to wait 10 seconds between each iteration. Introducing such a wait will mean no noticable impact on the system, whereas an unrestricted loop should be avoided and might/should quickly cause a S322 abend.
Back to top
View user's profile Send private message
@shim

New User


Joined: 28 Oct 2021
Posts: 10
Location: India

PostPosted: Tue Mar 29, 2022 2:42 pm
Reply with quote

Thanks Joerg & Willy for your response. This helps !!
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2594
Location: Silicon Valley

PostPosted: Wed Mar 30, 2022 12:27 am
Reply with quote

Quote:
external systems puts the data in mainframe

If I was doing this...

That external system knows exactly when it uploaded a new file. I would have that external system to use FTP to submit a job to process the new file. This has the benefit of it knowing the exact name of the file and you do not have to search for it.

In FTP, use:
Code:
SITE SUBSYS=JES

and then use the PUT command for a file containing JCL to submit a job.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1335
Location: Bamberg, Germany

PostPosted: Wed Mar 30, 2022 1:38 am
Reply with quote

Pedro wrote:
In FTP, use:
Code:
SITE SUBSYS=JES

and then use the PUT command for a file containing JCL to submit a job.

It might be restricted what can be submitted this way. Users can specify FILE=JES with an FTP PUT statement allowing this into the system in batch. JES under z/OS will make a SAF call under the class of JESJOBS when batch jobs enter the reader. This is done for all batch jobs, not just FTP.

See also JESINTERFACELEVEL (https://www.ibm.com/docs/en/zos/2.4.0?topic=protocol-jesinterfacelevel-ftp-server-statement)
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Wed Mar 30, 2022 5:03 am
Reply with quote

if the people sending the file thru FTP belongs to a different organization
( as it happens now quite often )
it would be a very bad idea to have them submit jobs

FTP with file triggering would be the best solution IMO
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Run rexx with JCL Job CLIST & REXX 1
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts REXX/CMS How to place command console... CLIST & REXX 4
Search our Forums:

Back to Top