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

Submitting a Connect Direct job via REXX


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

New User


Joined: 04 Aug 2009
Posts: 3
Location: UK

PostPosted: Wed Aug 26, 2009 4:01 pm
Reply with quote

Couldn't find anything that matched this so apologies if done before.

Essentially, I am writing some very simple REXX which will run a ConnectDirect which sends a file from the mainframe to a server. The problem I have is that the the ConnectDirect continuation is || so when running the ConnectDirect via REXX its translating it incorrectly.

This is the bit of REXX

Code:

 ADDRESS ISPEXEC                       
jobname = userid() || '1'             
"FTOPEN TEMP"                         
"FTINCL CDJOB"                       
"FTCLOSE"                             
                                       
"VGET (ZTEMPF)"                       
ADDRESS TSO                           
x = OUTTRAP('rec.')                   
"SUBMIT '"ZTEMPF"'"                   
x = OUTTRAP('OFF')   


Which submits something like this

Code:

//&JOBNAME JOB  (NDV,0140),'test',MSGCLASS=I,         
//       CLASS=K,REGION=8000K                                 
//*******************************************************************           
//  EXEC CDDEV                                                     
//*******************************************************************           
//SYSIN       DD   *                                                           
  SIGNON NODE=HXNDMDVC                                                         
  SUBMIT PROC=HXSND01 -                                                         
    &&FROMNODE =  HXNDMDVC  -                                                   
    &&TONODE   =  CD.INFRR0002 -                                               
    &&FROMDSN = TEST.MAINF.FILE.TOSEND -                                         
    &&TODSN    =  \'\\THISISTHE\\FILEPATH\ || -     
    \\\TOSENDTHEFILE\\FOLDER\ || -       
    \\\RECEIVED FILE.TXT' \ -                             
    &&SYSOPTS  =  \SYSOPTS='\ || -               
                 \DATATYPE(TEXT) \ || -           
                 \STRIP.BLANKS(NO) \ || -         
                 \XLATE(YES)'\ -                 
    &&COMPRESS =  COMPRESS -                     
    &&CKPT     =  CKPT=0M                         
SIGNON         


If submitted outside REXX, the above SYSOPTS (for example) would translate as

Code:


&SYSOPTS=SYSOPTS='  DATATYPE(TEXT)   STRIP.BLANKS(YES)   XLATE(YES)'



When submitted via the REXX they come out as

Code:



&SYSOPTS=SYSOPTS=' |  DATATYPE(TEXT)  |  STRIP.BLANKS(NO)  |  XLATE(YES)' 



Which obviously causes a syntax error in ConnectDirect. Same sort of issue the file path. I considered building them in REXX but the continuation problem remains even if I use variables (because the variable string won't fit on 1 line of 80 bytes)

I have checked and || is apparently the only continuation available in ConnectDirect

Any ideas?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 26, 2009 4:08 pm
Reply with quote

How do you build the JCL to be submitted, instream or do you use ISPF file tailoring.
Back to top
View user's profile Send private message
hammie

New User


Joined: 04 Aug 2009
Posts: 3
Location: UK

PostPosted: Wed Aug 26, 2009 4:29 pm
Reply with quote

The JCL is just in the ISPSLIB PDS - pretty much exactly what you see above.
Back to top
View user's profile Send private message
hammie

New User


Joined: 04 Aug 2009
Posts: 3
Location: UK

PostPosted: Wed Aug 26, 2009 4:45 pm
Reply with quote

You spend all morning fannying, register for a forum and then go and figure it out for yourself. Typical

For anyone interested, set up the cont variable in the REXX

Code:
ADDRESS ISPEXEC                       
jobname = userid() || '1'               
cont =  ' || - '                       
"FTOPEN TEMP"                           
"FTINCL CDJOB"                       
"FTCLOSE"                               
                                       
"VGET (ZTEMPF)"                         
ADDRESS TSO                             
x = OUTTRAP('rec.')                     
"SUBMIT '"ZTEMPF"'"                     
x = OUTTRAP('OFF')               



Then use it in the connectdirect

Code:

//&JOBNAME JOB  (NDV,0140),'test',MSGCLASS=I,         
//       CLASS=K,REGION=8000K                                 
//*******************************************************************           
//  EXEC CDDEV                                                     
//*******************************************************************           
//SYSIN       DD   *                                                           
  SIGNON NODE=HXNDMDVC                                                         
  SUBMIT PROC=HXSND01 -                                                         
    &&FROMNODE =  HXNDMDVC  -                                                   
    &&TONODE   =  CD.INFRR0002 -                                               
    &&FROMDSN = TEST.MAINF.FILE.TOSEND -                                         
    &&TODSN    =  \'\\THISISTHE\\FILEPATH\ &CONT
    \\\TOSENDTHEFILE\\FOLDER\ &CONT
    \\\RECEIVED FILE.TXT' \ -                             
    &&SYSOPTS  =  \SYSOPTS='\    &CONT             
                 \DATATYPE(TEXT) \ &CONT       
                 \STRIP.BLANKS(NO) \ &CONT     
                 \XLATE(YES)'\ -                 
    &&COMPRESS =  COMPRESS -                     
    &&CKPT     =  CKPT=0M                         
SIGNON         


Not sure what the difference is, but I am not going to argue!
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 26, 2009 4:51 pm
Reply with quote

Look on the bright side, at least you got a result icon_lol.gif
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