1

I have a COBOL file on my desktop, with .cbl as its filetype.

I want to transfer this .cbl file to a sequential file on a mainframe (file format=PS), by using some REXX code.

Can anybody suggest me how to do so? Any sample code would be greatly appreciated.

Pierre.Vriens
  • 2,117
  • 75
  • 29
  • 42
  • Why can you not use FTP? – cschneid Sep 16 '14 at 11:38
  • Yes..I can use FTP method..but FTP is done by manually. but I want to do FTP process automatically.I will only provide userid,pwd and program name...the GET or PUT process will be done in background.No need to put the get or put command manually.. – Dip Kumar Ghosh Sep 16 '14 at 17:35
  • What desktop OS, and why the requirement for REXX? For Windows, you could use a batch file, and for Mac/Linux, and shell script. – Kevin McKenzie Sep 21 '14 at 13:20

1 Answers1

1

Maybe you want to consider using the ISPF Workstation Agent (WSA), as explained in this great presentation also, from only a few weeks ago.

Here is a quote from page 2 of it:

  • One of ISPF's ‘best kept secrets’ is the Workstation Agent (WSA)
  • It is FREE and comes with the z/OS operating system
    • WSA is a Client/Server component of ISPF
    • No mainframe setup or installation required
  • Executes ISPF on the PC and maintains a connection to the mainframe
  • WSA provides the ability to
    • Display ISPF in GUI display
    • Allows distributed editing
      • Edit mainframe files on the PC and edit PC files from the mainframe
    • Capability to transfer files
      • Both in foreground and batch

Below are some REXX code excerpts to DOWNLOAD some file from a mainframe (with DSN=MfFile) to your workstation (stored in wds).

Obviously the question here is about upload, which I haven't used yet, but which is probably similar.

Step 1: Establish a WSA connection from the MF to WS (at IP address 'waddr'):

 "ispexec wscon IP(waddr) CODEPAGE("wscp") CHARSET("wsch") NOGUIDSP"

Step 2: Transfer the file from MF (file=MfFile) to WS (file=wds)

 if substr(reverse(wpath),1,1)='\' then wds=wpath||wfile 
 else wds=wpath||"\"||wfile               
 "ispexec filexfer host(MfFile) ws(wds) to(WS) TEXT" 

Step 3: Open the file on the WS (file extension on WS determines which default appl ...)

 select
   when wOpenYN='Y' then xcmd=wds
   when wOpenYN='N' then xcmd=' '
   otherwise xcmd=' '
   end
 if xcmd<>' ' then "ispexec select wscmd("xcmd")"      

Step 4: Close the WSA connection

 "ispexec wsdiscon"
Pierre.Vriens
  • 2,117
  • 75
  • 29
  • 42