Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Can I do a Connect : Direct using REXX?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Can I do a Connect : Direct using REXX?
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

Moderator Team Head


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

PostPosted: Wed Apr 26, 2006 10:52 pm    Post subject: Re: Can I do a Connect : Direct using REXX?
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    Post subject: Re: Can I do a Connect : Direct using REXX?
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

Moderator Team Head


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

PostPosted: Thu Apr 27, 2006 2:06 am    Post subject: Re: Can I do a Connect : Direct using REXX?
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    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Apr 27, 2006 2:35 am    Post subject: Re: Can I do a Connect : Direct using REXX?
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    Post subject: REXX to perform a Connect:Direct (NDM) copy
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

Site Director


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

PostPosted: Mon Apr 29, 2013 11:38 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts DIrect link of dynam/nodynam nkjain87 COBOL Programming 2 Mon Apr 24, 2017 6:23 pm
No new posts Connect:Direct - RC=000000FF MSG=SVTM... R.Manivannan All Other Mainframe Topics 3 Fri Apr 21, 2017 1:30 am
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us