View previous topic :: View next topic
|
Author |
Message |
new2cobol
New User
Joined: 04 Jan 2006 Posts: 77 Location: Bangalore
|
|
|
|
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 |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
new2cobol
New User
Joined: 04 Jan 2006 Posts: 77 Location: Bangalore
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
new2cobol
New User
Joined: 04 Jan 2006 Posts: 77 Location: Bangalore
|
|
|
|
I guess that is what I want, innit? Build SYSIN DD params dynamically! Thanks superk!!! |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
Jim Herrmann
New User
Joined: 09 Apr 2013 Posts: 3 Location: US
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
Thanks for posting your code - it will surely help someone
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 |
|
|
Jim Herrmann
New User
Joined: 09 Apr 2013 Posts: 3 Location: US
|
|
|
|
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 |
|
|
|