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

Creates a dataset and then through the same rexx to edit


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

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Thu Aug 17, 2006 4:30 pm
Reply with quote

Hi,

I am facing a problem while writing a rexx.
I am submitting a job using rexx.
My Job creates a dataset and then through the same rexx I need to edit it ( using macros ).
How to do this ??? As you never know when your job will be completed and that dataset will be created.

Please advise.Thanks for all the help.


ap_mainframes
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Aug 17, 2006 5:46 pm
Reply with quote

From the same job, after the dataset was created, use the ISPF service EDIT with the MACRO parameter. Supply a name of an edit-macro to be used when the dataset will open for EDIT.

O.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Fri Aug 18, 2006 9:14 am
Reply with quote

Quote:
From the same job, after the dataset was created


What exactly do you mean by that??
Can you please give some example???


Thanks
Ap[/quote]
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Aug 18, 2006 9:26 am
Reply with quote

Help us out a little bit here. I think we're all presuming that you have a job, JOBA, running. JOBA contains a REXX exec that ultimately submits another job, JOBB. JOBB catalogs a dataset and finishes. Does the exec in JOBA know what the dataset name is? Can the exec in JOBA contain a loop that executes continously until the dataset is cataloged? Or, can the exec in JOBA (because it SHOULD know the jobid of JOBB) look for the EOJ of JOBB via a TSO STATUS command?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Fri Aug 18, 2006 12:18 pm
Reply with quote

It can all be in the same job, same REXX: ALLOCATE and EDIT. Even the Edit-Macro can be generated from within the REXX, to be used in the EDIT service.

O.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Mon Aug 21, 2006 12:40 pm
Reply with quote

No..I have a rexx thru which I am submitting a job.
Please see my rexx code below

Code:

       QUEUE '//'UID'AB JOB (DFCED,WD1),''FD BKUP FRM CSTID'',CLASS=S,'
       QUEUE '//    NOTIFY='UID',TIME=1440,MSGCLASS=T'
       QUEUE '//STEP000  EXEC PGM=IEFBR14 '
       QUEUE '//DD1      DD DSN=DFC2.'UID'.GLOB.FFB.COMPARE.REPORT,'
       QUEUE '//             DISP=(MOD,DELETE,DELETE),'
       QUEUE '//             SPACE=(TRK,(0,0)) '
       QUEUE '//************************************ '
       QUEUE '//FASTEP   EXEC PGM=FILEAID,REGION=6M'
       QUEUE '//STEPLIB  DD  DISP=SHR,DSN=SYS4.FILEAID.V890.LOAD'
       QUEUE '//SYSPRINT DD  SYSOUT=*'
       QUEUE '//SYSLIST  DD DSN=DFC2.BEST.GLOB.FFB.COMPARE.REPORT,'
       QUEUE '//             DCB=(LRECL=183,BLKSIZE=1830),'
       QUEUE '//             DISP=(NEW,CATLG,DELETE),'
       QUEUE '//             SPACE=(CYL,(50,50)) '
       QUEUE '//DD01     DD  DSN='BKFILE','
       QUEUE '//             DISP=SHR'
       QUEUE '//DD01C    DD  DSN='DDN','
       QUEUE '//             DISP=SHR'
       QUEUE '//DD01CP   DD  DSN=ZZZZZ,'
       QUEUE '//             DISP=SHR'
       QUEUE '//DD01SC   DD  DISP=SHR,'
       QUEUE '//          DSN=XXXXX(SELECT)'
       QUEUE '//DD01SCN  DD  DISP=SHR,'
       QUEUE '//          DSN=YYYY(SELECT)'
       QUEUE '//DD01RL   DD  DSN=PF00.CP000000.HFNP.CPY,'
       QUEUE '//             DISP=SHR'
       QUEUE '//DD01RLN  DD  DSN=PF00.CP000000.HFNP.CPY,'
       QUEUE '//             DISP=SHR '
       QUEUE '//SYSIN    DD  *'
       QUEUE '$$DD01 COMPARE'
       QUEUE '/*'
       "SUBMIT * "


Here, this rexx (and in turn job) is creating a dataset called as DFC2.BEST.GLOB.FFB.COMPARE.REPORT.

I need to edit this dataset, in this very rexx.
How to do this ??

Thanks for all the help
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Aug 21, 2006 2:30 pm
Reply with quote

You will have to wait until the job ends successfully (which is a bad practice, IMHO). When the job completes succesfully, use the ISPF service EDIT, or use EXECIO to manipulate the data in the dataset.

O.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Aug 21, 2006 3:55 pm
Reply with quote

Didn't I already provide an answer?
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Mon Aug 21, 2006 7:06 pm
Reply with quote

Superk,

I didnt get the solution you provided.
Can you please explain??

ofer71,
Whats the solution to this then???

Thanks
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Aug 21, 2006 7:09 pm
Reply with quote

Add a step to your QUEUEd job.

O.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Tue Aug 22, 2006 9:40 am
Reply with quote

And what will that step do ???
Actually I am an assembler guy and have never worked on REXX( just know the basics ) , so please explain, if possible.

ap
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Aug 22, 2006 10:07 am
Reply with quote

The additional step will run another REXX. This REXX will issue the ISPF service EDIT with the MACRO parameter.

O.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Wed Aug 23, 2006 10:03 am
Reply with quote

Thanks!
However can you please examplify how do we call rexx from JCL??
I tried to make a search but couldnt get a proper search results.
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