Difft methods :File transfer from Local Machine to Mainframe



IBM's Command List programming language & Restructured Extended Executor

Difft methods :File transfer from Local Machine to Mainframe

Postby nbalamani » Sun Jan 02, 2011 1:58 am

Hi,
My file transfer requirement is similar to that of most other users [but chose to post a new topic because i have a few questions]:

1.Take an existing PS File
2.Convert it into Excel format
3.Transfer the excel sheet from Mainframe (server?) to the local Desktop.

While i am here mainly for a solution ofcourse , i have a few other questions too...
Here's what i have tried :

1.FTP :
Like Robert indicates in most of his replies -- my local desktop does not have a FTP connection.
I tried a manual FTP from the command prompt and the file transfer was successful.
But my JCL refused to connect to the same hostname giving an error : recv error from getNextReply - EDC8128I Connection refused.

OMVS steps mentioned in the other threads are beyond my scope.
I am at a junior level and will have to take permissions from N number of people for that.
But will give it a shot while i try to make the other options work out for me.I am little nervous about tampering with any settings or installing anything new.

2.REXX :

I discovered : LINEOUT() -- the inbuilt function in REXX to take value from a variable or user and put it into a file on the desktop machine.
I was willing to change my rexx code to suit the lineout() function.
Lineout() works from my local machine which has the regina interpreter.
But not from my TSO/ISPF mainframe session.
It gives the error : Routine not found.

Can we fix this ? Should i be including some sort of library file into my rexx code ?
Do i need to install something specifically for OREXX ?
How do i see what utilities,inbuilt functions,libraries are present in the REXX in our mainframe envmt ?

3.IND$FILE :

When we manually convert the PS to text onto the desktop using the utility it produces the following command :

IND$FILE GET 'XXX.XXXX.XXXX.XXXXX' ASCII CRLF

Can we alter the ind$file command by inserting a destination file into this command ?
Also , if FTP is not setup in a machine , how is this utility able to carry out the transfer ?


SO for now :
I will work on the OMVS portion
Find out about emailing the file[and alter my code if this works]
And about the last and a pathetic resort --- can we use REXX to simulate the manual steps taken at the 3.7 screen to carry out file transfer using REXX ?

Summary :

Why wont my FTP-JCl work ? I tried all hostnames i could get my hands on.
Can we fix the " lineout() : Routine not found " error by installing an OREXX related library file or utility ?
How is IND$FILE able to do the transfer ?
Can we alter IND$FILE by adding a destination to the GET command ?

Thanks for your time,
Balamani
:twisted: No Question is dumb.
nbalamani
 
Posts: 4
Joined: Sun Jan 02, 2011 1:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: Difft methods :File transfer from Local Machine to Mainframe

Postby nbalamani » Sun Jan 02, 2011 2:06 am

Oops!Oops!Oops
Missed out on one thing ::

With the FTP Step :
My system does not have FTP.Login fails to any hostname i punch in.So like Robert patiently mentions in every other post here -- i dont have FTP.
The file transfer using FTP was successful on my colleague's[senior] system.And a JCL run from the same system failed with the error:
recv error from getNextReply - EDC8128I Connection refused.

Balamani
:twisted: No Question is dumb
nbalamani
 
Posts: 4
Joined: Sun Jan 02, 2011 1:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: Difft methods :File transfer from Local Machine to Mainframe

Postby MrSpock » Sun Jan 02, 2011 2:29 am

I don't really know what you're trying to get at here, since you've seem to have already answered your questions. But, I'll make some comments:

1. In order for FTP to function, there HAS to be a client and a server. If you don't have an active FTP server to connect to, then it can't be done. Period. End of story. I'll never understand why, if you have a business need to transfer files, your company won't provide an adequate solution.

2. You can sometimes initiate a transfer from your 3270 terminal emulation software, which works because it requires you to be connected to a logged into your TSO session. This will initiate the IND$FILE command on the host, which will then download/upload the files to where you specify.

3. There is the ISPF File Transfer Option (3.7) that many user seems to forget about. If you can download, install, and properly configure the client on your desktop, then you can use this service to transfer files.

4. Unless it's prohibited (and it should be), why not send a file as an email attachment, per your site's standard process for doing so?

5. Any company who values security and confidentiality should completely prohibit any ad-hoc transferring of data between platforms. There's nothing like someone stealing proprietary or confidential data to bring a company's lack of security measures into the spotlight, along with the wrath and scrutiny of auditors.

6. The TSO/E REXX implementation doesn't support linein/lineout.
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Difft methods :File transfer from Local Machine to Mainframe

Postby Robert Sample » Sun Jan 02, 2011 4:32 am

You keep mentioning your FTP JCL failed to connect. If you are attempting to connect to your desktop, as has been said many, many, many, many times here -- your desktop is not a server and a mainframe job cannot connect to it. The site that is initiating the FTP is the client and the remote site is the server -- this is by the very definition of FTP and cannot be overridden or changed. Hence, if your desktop initiates the FTP connection then you should be able to do any FTP transfer needed as long as your site allows it. However, if the mainframe initiates the FTP connection, then the remote connection must be a server, not a desktop.

Your 3270 emulator software will have the IP address or DNS name of the mainframe -- usually in the configuration or connection setup area -- and that is the name (or IP address) used on the desktop side to connect to the mainframe. Once connected, the usual GET and PUT commands work to respectively retrieve or send data sets from or to the mainframe.

Many sites also use FTP packages such as WS-FTP on desktops; you would still initiate the connection to the mainframe from the desktop since the mainframe must be the server as desktops do not have the correct software to be able to run as servers.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Difft methods :File transfer from Local Machine to Mainframe

Postby steve-myers » Sun Jan 02, 2011 9:30 am

IND$FILE is initiated in a 3270 session running in your workstation. It cannot be used in a batch program to initiate a conversation with your workstation. Period. End of story.

I'm rather surprised no one has commented on your proposal to create an Excel file as a dataset on the mainframe. An Excel file is a binary file that would be difficult to create on the mainframe. What mainframe types usually do is create a CSV (Comma Separated Variable) dataset and send it to the workstation as a text file. The dataset would look like -

Cell,Cell,...
Cell,Cell,...

Each line in the CSV dataset conforms to a row in the spreadsheet.

Some years ago I was involved with a project to analyze SMF data for performance analysis. I had a large Assembler program that produced nice reports that were tailored to the analysis I was doing. Late in this project I realized sending the report data to a workstation spreadsheet would be a Good Idea. It turned out the data had to be sorted differently than in the mainframe report to be useful as a spreadsheet, but this was not difficult since the report program was already doing substantial sorting so adding a new sort was almost trivial. Colleagues were able to take this data, load it into Excel, and generate some very nice graphs.

I do not presently use Excel; I use the spreadsheet program in OpenOffice.org. The OpenOffice.org spreadsheet takes the same CSV files as Excel, but the graphing function appears to be inferior to Excel's. One thing I found curious is OpenOffice.org accepts formulas in a cell. I have no idea if Excel does this; I do not use any M$ Office products on my personal machines, so I can't test this idea.

The WS-FTP program that Mr. Sample mentioned is an FTP client that runs as a Windows application rather than than command line FTP application that is part of M$ Windows and runs in a Command Prompt window. I have never used WS-FTP, though many people seem to think it's excellent.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Difft methods :File transfer from Local Machine to Mainframe

Postby prino » Sun Jan 02, 2011 3:13 pm

Steve,

steve-myers wrote:... One thing I found curious is OpenOffice.org accepts formulas in a cell. I have no idea if Excel does this; I do not use any M$ Office products on my personal machines, so I can't test this idea.


Excel does take formulae in CSV files, used this "feature" in 2001 to create complete spreadsheets on the mainframe, that did not need any additional processing on the PC, and later again in 2004/5. There's probably still some code (RAPEXCEL?) in my EXEC library on "that" system, feel free to have a look. ;)
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

Re: Difft methods :File transfer from Local Machine to Mainframe

Postby Pedro » Wed Jan 05, 2011 3:14 am

LINEOUT() -- the inbuilt function in REXX to take value from a variable or user and put it into a file on the desktop machine.


I think you have a mis-conception about what LINEOUT does... Your statement implies that you want a z/OS rexx program to write to your desktop machine, but it does not work like that. Your regina works because the rexx runs on your desktop machine and writes to files on the same machine.

And about the last and a pathetic resort --- can we use REXX to simulate the manual steps taken at the 3.7 screen to carry out file transfer using REXX ?

I do not consider it pathetic, but a very workable solution.

I have gotten something like this to work... from a z/OS rexx program:
some setup:
1. download ISPF work station client from ISPF option 3.7
2. install and start the ISPF work station client
3. use 'options' to setup System Register.

From z/OS rexx:
1. from rexx program, issue WSCON service to connect to the ISPF work station client (you need to know your desktop host name)
2. invoke the ISPF editor while specifying your workstation file:
Address ISPEXEC   
wsname = "c:/mystuff/workstationfile.txt"   
"EDIT WSFN(wsname)   MACRO(myedit)"                           

3. In the 'myedit' ISPF editor macro:
a. (maybe) delete all existing lines
b. copy lines from your z/OS file.
c. END the editor session.

4. issue WSDISCON to disconnect.

It should be able to run from an ISPF batch job.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Difft methods :File transfer from Local Machine to Mainframe

Postby Pedro » Wed Jan 05, 2011 3:26 am

I tried all hostnames i could get my hands on.

There is no reason to guess. On your desktop, right click on 'my computer', select properties, click on 'computer name' tab. Look at the 'Full computer name' field. Or from a DOS prompt, type HOSTNAME
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Difft methods :File transfer from Local Machine to Mainf

Postby nbalamani » Sat Jan 15, 2011 10:41 pm

Hi All,
Thanks so much for all the responses....
Not drafting my question properly has caused quite some trouble.

I managed to fix my JCL -- it does connect to the server and fetch a file.
Used this :: GET 'My.ps.file'

And so it worked,the FTP login was successful and it did transfer my PS file.

BUT --- it appears to transfer the file to the home directory alloted to the user by the mainframe server.

I believe this is happening because,we connect to the mainframe server through VPN and thus our desktop is essentially just a terminal.
So submitting my JCl is like logging into the mainframe server through FTP and asking the server to store a copy of the PS file into its own remote directory.
The FTP from Windows is successful becuase its the local machine which requests the file from the mainframe server.
Please correct me here.

But i am not giving up , because if IND$FILE is able to get a file from mainframe to the local machine --- so will my JCL someday :)
Its not worth mentioning here, but tried a REXX code for FTP.Needless to say , it did the exact same thing.

When i tried : GET 'My.ps.file' 'D:\destinationfolder'

It gave a "INVALID IDENTIFIER" error.Basically , it does not recognize any Windows-related commands like LCD , CD .. , CD\ etc.

I never really thought of converting the PS file into a "excel file" in the mainframe enmvt itself...thought it was impossible.
It opens up a new line of thinking...Will find out more about CSV datasets once i get the JCL running successfully.

Came across "Tab limited files". Need to get more information on that.

I tried to use the hostname of the local machine -- did not work :(

I feel really encouraged by Pedro's post on what can be done with ISPF 3.7 option.Will give it a shot.
And on lighter note,this approach seemed pathetic because i felt it is poor programming to try to simulate manual steps :)
Guess i am wrong...

Looking forward to your suggestions on the JCL....

Summary :

1.JCL works , but stores file on the home directory of the server itself.
Which brings me back to the question : How is IND$FILE doing it ??

2.Use any Windows related commands and it throws an error [going by the terminal - server thing i mentioned , rather obvious]

3.Will Work on the Pedro's fix for the ISPF 3.7 screen.

4.If i can successfully run the JCL and get a file to my desktop --will work on CSV and Tab limited text file.

Thanks and Regards,
Balamani
:twisted: No Question is dumb
nbalamani
 
Posts: 4
Joined: Sun Jan 02, 2011 1:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: Difft methods :File transfer from Local Machine to Mainf

Postby dick scherrer » Sun Jan 16, 2011 12:17 am

Hello,

1. It doesn't matter as IND$FILE has nothing to do with FTP.
2. You might consider doing the ftp from the ftp client on the desktop and "pull" the file. A small automated process could be implemented on the desktop to log onto ftp on the mainframe and download the data.
4. Using one delimiter or another has nothing to do with the transfer directory.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post