Reputation: 11
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.
Upvotes: 1
Views: 671
Reputation: 2117
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"
Upvotes: 1