Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
wait till jcl creates dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
seenivasakan
Currently Banned

New User


Joined: 13 May 2007
Posts: 21
Location: Karnataka

PostPosted: Wed Apr 09, 2008 4:04 pm    Post subject: wait till jcl creates dataset
Reply with quote

Greetings.

i have a requirement to create some file using JCL. i coded the jcl in the rexx script and submitted the same. The output of JCL has to be the input for the REXX script.

How i can delay the execution of my rexx script till JCL creates the dataset. Is there any way to check the dataset status?

Regards
Back to top
View user's profile Send private message
References
PostPosted: Wed Apr 09, 2008 4:04 pm    Post subject: Re: wait till jcl creates dataset Reply with quote

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 2959
Location: Brussels once more ...

PostPosted: Wed Apr 09, 2008 4:28 pm    Post subject:
Reply with quote

Are you doing this in foreground ?

Just think ..... for example, all initiators are in use and your job sits waiting for a couple of hours before it gets processed, and your REXX script is just sitting there looking for a dataset, totally blocking your terminal for any useful purpose.

Why not tag the secondary REXX processing as a step in the batch job ?
Back to top
View user's profile Send private message
seenivasakan
Currently Banned

New User


Joined: 13 May 2007
Posts: 21
Location: Karnataka

PostPosted: Wed Apr 09, 2008 4:34 pm    Post subject: Reply to: wait till jcl creates dataset
Reply with quote

Hi Expat,

Thanks for your reply.

Unfortunately, this rexx script has to run in the Foreground. Basically this will get the PDS name(copybook library name) from the user and extracts the members (copybooks) and then a JCL is submitted calling Fileaid to print the Members layout. the layout is captured in a file(JCL Creates)

the above file is taken as a input by Rexx Script.

So any other way to go ahead????????
Back to top
View user's profile Send private message
feellikeneo

Active User


Joined: 19 Mar 2007
Posts: 77
Location: Chennai

PostPosted: Wed Apr 09, 2008 4:39 pm    Post subject:
Reply with quote

Hi Seeni,

Can you try running your REXX script as a next step. Meaning run the JCL in step1 and your rexx macro in step2.

Hope this helps
Back to top
View user's profile Send private message
seenivasakan
Currently Banned

New User


Joined: 13 May 2007
Posts: 21
Location: Karnataka

PostPosted: Wed Apr 09, 2008 5:20 pm    Post subject: wait till jcl creates dataset
Reply with quote

But input to JCL (Copybook library name) has to be obtained from User through some ISPF panels.

Based on the Library name, members are extracted and given to JCL. the jcl creates some datasets. The dataset has to be used by REXX.
Back to top
View user's profile Send private message
Ashwin_mudikon

New User


Joined: 03 Apr 2007
Posts: 33
Location: Chennai

PostPosted: Wed Apr 09, 2008 5:56 pm    Post subject:
Reply with quote

The best option would be to have your second rexx program as the next step in the jcl.

If you want to do it online then after submitting the job, get into a forever loop and use the STATUS command to check the status of the job until it is over. However this is not a good way to do when your job is going to run for a long time.
Back to top
View user's profile Send private message
Marso

Active User


Joined: 13 Mar 2006
Posts: 288
Location: Israel

PostPosted: Wed Apr 09, 2008 8:45 pm    Post subject:
Reply with quote

I have rexx programs that run SORT or ISRSUPC without any jcl:
Code:
Srt. = ""
Srt.1 = "  JOINKEYS FILES=F1,FIELDS=(1,4,A),"
Srt.2 = "    INCLUDE=(6,8,CH,EQ,C'"Left(ProgName,8)"')"
Srt.3 = "  JOINKEYS FILES=F2,FIELDS=(1,4,A)"
Srt.4 = "  REFORMAT FIELDS=(F2:1,5,F2:49,4)"
Srt.5 = "  SORT FIELDS=COPY"
"EXECIO * DISKW SYSIN (FINIS STEM Srt."

"ALLOC F(SORTJNF1) DA('"TransTree"') SHR"
"ALLOC F(SORTJNF2) DA('"TransInfo"') SHR"
"ALLOC F(SORTOUT) NEW SPACE(10,5) TRACKS UNIT(SYSDA) REUSE",
   "RECFM(F,B) BLKSIZE(450) LRECL(9)"
"CALL *(SYNCSORT)"

"EXECIO * DISKR SORTOUT (FINIS STEM TransList."
"FREE F(SORTJNF1 SORTJNF2)"
"FREE F(SORTOUT)"

In this example, SYNCSORT is executed synchronuously.
Once the sort finished, the data in SORTOUT is immediately available.
No doubt something like this can be achieved with FileAid.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 159
Location: Pune

PostPosted: Thu Apr 10, 2008 11:06 am    Post subject:
Reply with quote

There is another way of keeping your REXX exec to wait.
I used it for submitting a job from Rexx exec and made the exec to wait till the job is completed for further processing.

In your case, you can probably use it in this way.
I am sure it is not practically correct. But you can use your own logic for
making your REXX exec wait till something is completed.

Do until SYSDSN(DSNAME) = 'OK'
CALL SYSCALLS('ON')
ADDRESS SYSCALL
"SLEEP" 1
CALL SYSCALLS 'OFF'
END
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 2959
Location: Brussels once more ...

PostPosted: Thu Apr 10, 2008 12:09 pm    Post subject:
Reply with quote

Srihari Gonugunta

If you worked for me, you would not be doing so for very long.

If you are happy to sit there waiting for a job to complete with a locked terminal rather than spending that time doing anything else more productive ....................... icon_evil.gif
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 159
Location: Pune

PostPosted: Thu Apr 10, 2008 12:50 pm    Post subject:
Reply with quote

Hmmm.....true....Sometimes, it is better to wait to get something done...Just don't mind...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1