Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rexx loop

Status
Not open for further replies.

Fern7519

Technical User
May 2, 2018
1
US
Hello,

I'm new using REXX. I would like to build a script that will generate jobs that require to loop the Jobname field. For example. I have to copy 500 DSN's but I need to submit the copy jobs five at time.

What I have built so far is able to create all 500 copy jobs

But upon adding the new rexx code, it loops the jobname COPY01 - COPY05 to every single DSN. Leaving me with 2500 copy jobs, basically 5 copy jobs for every single DSN. I would only like to break down all 500 copy jobs so they will only loop the jobname once through the first 5 DSN's and continue looping until all 500 built.

Thanks.

Here is what I have so far:

DO FOREVER
"EXECIO 1 DISKR INFILE"
IF RC = 2 THEN LEAVE
PULL INFILE_REC

I=00
DO TC=I TO 05 BY 1

DSN = SUBSTR(INFILE_REC,1,10)

JDSN = DSN


QUEUE "//COPY"TC" JOB (P,VZFT,XO0938),'DSN-"JDSN"', "
 
I have not got a real idea of what you are doing! You are doing a FOREVER with no END and a DO i = 0 TO 5 also with no END. Assuming this is a code snipptet and the ENDs are further on what this is doing is:
read a record
repeat the following 5 times
QUEUE a job​

Are you doing 5 copies in one job or one copy per job. If the latter, why are you bothering to do 5 at a time?
You do know that the commment field on the job card is limited to 22 bytes (unless it has been changed in recent years)?



Nic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top