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

Can I do a Connect : Direct using REXX?


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

New User


Joined: 04 Jan 2006
Posts: 77
Location: Bangalore

PostPosted: Wed Apr 26, 2006 9:26 pm
Reply with quote

I have been asked to connect direct a number of files, say X | X varies every day, to another machine. I know the names of the files, I know the location it is to be shipped. Now as X is varying, I can't do a JCL to do the stuff... I know FTP using REXX, so is it possible to do a connect direct using REXX?

If not I wil have to hit myself with a mace. I suggested Connect Direct as the mode of file transfer icon_cry.gif icon_cry.gif
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Wed Apr 26, 2006 10:52 pm
Reply with quote

Sure.

I mean, there's no direct REXX-to-C : D interface - you'll still need to use the DMBATCH utility and you'll still need to use the SUBMIT PROC command, but it works the same way in REXX as in a batch job.
Back to top
View user's profile Send private message
new2cobol

New User


Joined: 04 Jan 2006
Posts: 77
Location: Bangalore

PostPosted: Thu Apr 27, 2006 1:28 am
Reply with quote

Ok, superk, you mean, I can do a TSO EXEC DBMBATCH, after including all the libraries?

How do I include the submit proc in REXX?
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Apr 27, 2006 2:06 am
Reply with quote

No, you would use the TSO CALL command (presuming you are running in a TSO address space):

Code:

/* REXX */
... housekeeping stuff ...
"CALL *(DMBATCH)   'YYSLYNN'"   
or
"CALL 'CONNECT.DIRECT.LOADLIB(DMBATCH)'   'YYSLYNN'"
...


You still need the same commands in the SYSIN DD:

Code:

  SIGNON ESF=YES             
  SUB PROC=Procname
  SIGNOFF                     

  or

  SIGNON ESF=YES             
  SUB DSN=MY.PROCESS.LIB(Procname)
  SIGNOFF                     


So, as you can probably tell, I don't see any advantage to doing this with REXX, other than allowing you to build the SYSIN DD contents dynamically. If your Process(es) allow for variable input and/or output filenames, then you should be all set.

Don't forget too that there are restrictions (site-specific) that specify how many processes you're allowed to submit at one time.
Back to top
View user's profile Send private message
new2cobol

New User


Joined: 04 Jan 2006
Posts: 77
Location: Bangalore

PostPosted: Thu Apr 27, 2006 2:29 am
Reply with quote

I guess that is what I want, innit? Build SYSIN DD params dynamically! Thanks superk!!!
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Apr 27, 2006 2:35 am
Reply with quote

The first shop that I worked in where I actually dealt with CONNECT : Direct used DB2 to dynamically build the Process statements for each job at runtime. The next shop first used Quikjob, then SAS, to do the same thing. REXX would work just as well.
Back to top
View user's profile Send private message
Jim Herrmann

New User


Joined: 09 Apr 2013
Posts: 3
Location: US

PostPosted: Mon Apr 29, 2013 11:27 pm
Reply with quote

I wrote this routine based on an NDM batch job. Data set names have been changed to protect the innocent.

It works for me (with the correct names of course):

Code:

/* Copy across SYSPLEXs */                                       
CopyNDM:                                                         
ADDRESS TSO                                                       
                                                                 
x = OUTTRAP(msgs.)                                               
                                                                 
"FREE DDNAME(DMPUBLIB DMMSGFIL DMNETMAP DMPRINT NDMCMDS SYSIN)"   
"ALLOC DDNAME(DMPUBLIB) SHR DSNAME('SYS.NDM.PROCESS.USER')"
"ALLOC DDNAME(DMMSGFIL) SHR DSNAME('SYS.NDM.MSG.VSAM')"         
"ALLOC DDNAME(DMNETMAP) SHR DSNAME('SYS.NDM.NETMAP.VSAM')"     
"ALLOC DDNAME(DMPRINT)             dataset(*)    "               
"ALLOC DDNAME(NDMCMDS)             dataset(*)    "               
                                                                 
"DELETE (ATEMP.ONE) NONVSAM"                                     
"ALLOC DSNAME(ATEMP.ONE) DDNAME(SYSIN) NEW TRACKS ",             
" SPACE(1,1) UNIT(SYSDA) KEEP CATALOG DSORG(PS) RECFM(F B) ",     
" LRECL(80) BLKSIZE(6160)"                                       
"FREE DDNAME(SYSIN)"                                             
"ALLOC DSNAME(ATEMP.ONE) DDNAME(SYSIN) MOD KEEP"                 
                                                                 
/* Create control statements */                                   
cc.1  = " SIGNON USERID=(,)  "   
cc.2  = " SUBMIT PROC=COPY SNODE=TGTNODE  - "   
cc.3  = "     HOLD=NO  - "   
cc.4  = "     CASE=YES  - "
cc.5  = "     &NODE=SRCNODE - "   
cc.6  = "     &DSN1=SRC.EXEC(NDMTEST)   - "   
cc.7  = "     &DSN2=TGT.EXEC(NDMTEST)  - "   
cc.8  = "     &DISP1=SHR  - "   
cc.9  = "     &DISP2=KEEP - "   
cc.10 = "     &COMPRESS=COMPRESS "   
cc.11 = " SIGNOFF "   
"EXECIO 11 DISKW SYSIN(STEM cc. FINIS"                           
"FREE DDNAME(SYSIN)"                                             
"ALLOC DSNAME(ATEMP.ONE) DDNAME(SYSIN) SHR"                       

/* Execute the copy */                                   
"CALL 'SYS1.NDM.SYSLINK(DMBATCH)' 'YYSLYNN'"             
                                                         
"FREE DDNAME(SYSIN)"                                     
"DELETE (ATEMP.ONE) NONVSAM"                             
"FREE DDNAME(DMPUBLIB DMMSGFIL DMNETMAP DMPRINT NDMCMDS)"
RETURN                                                   


I hope that helps.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Apr 29, 2013 11:38 pm
Reply with quote

Hello and welcome to the forum,

Thanks for posting your code - it will surely help someone icon_smile.gif

Having said that, i suggest that it is best to reply to currently active topics rather than a topic that has been dormant for 7 years.

One way around this is to start a new topic for your info and include the link to the "old" topic in the post.

Hope you find useful / entertaining things here,

d
Back to top
View user's profile Send private message
Jim Herrmann

New User


Joined: 09 Apr 2013
Posts: 3
Location: US

PostPosted: Tue Apr 30, 2013 1:10 am
Reply with quote

With Google, nothing is dormant for 7 years. ;-)

I found the topic while searching for what I was looking for, used the information, improved on it, and shared it back in the same place rather than starting a new thread on the same topic and fragmenting the discussion.

Thanks for your input.
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top