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
 

 

Submitting a Connect Direct job via REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Submitting a Connect Direct job via REXX
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: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 26, 2009 4:08 pm    Post subject:
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 26, 2009 4:51 pm    Post subject:
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    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. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm


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