I want to make a tool on REXX which can copy the data present on host or transfer the data(code) present in member of PDS in mainframe into a word document form or notepad. Alternatively we follow a lenghty process as shown in attachment.
I am a beginner in REXX so need help.Please guide me.
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
You can create a text fle on the mainframe that may be easily downloaded to the pc. This will not be in WORD format (or any other like Excel). It will just be a .txt file.
The downloaded .txt file may be opened by any of the Windows applications. If the text file has been created with delimiters, it will open very nicely in excel.
Joined: 07 Feb 2009 Posts: 1314 Location: Vilnius, Lithuania
It's very easy to create basic RTF documents on the mainframe, here's a very short example of one that has all the tags that you really need, paste it into a TEXT editor on the PC, save it as 'whatever.rtf' and it will open in about any word-processor
Code:
{\rtf1\ansi\deff0
{\fonttbl
{\f0\fmodern\fcharset0\fprq1 Courier New;}}
\paperw11907\paperh16840\margl851\margr851\margt851\margb851\pard\plain\sl-180\slmult0\fs18
{
{\b For a new trip:\par}
\par
o if mod(tripno, 10) = 1\par
- allocate new output library\par
\par
o getvar('}{\b textRAHP}{') -> Manual\par
- PCxxxx - update with PC generated versions\par
- PCWxxxx - update with PC generated versions\par
\par
o getvar('}{\b execRAHP}{') -> EHHUEXEC (Member) / BHHUEXEC (All, batch)\par
- REXXDATE - add new LLnn/LSnn/LTnn entries\par
- REXXDATL - add line t.nn with date/time for new trip\par
\page
o getvar('}{\b diffRAHP}{')\par
- L?nn - run PLI(RUN2PDS) (File: TRnn)\par
\par
o getvar('}{\b diffRAHP}{') -> EHHUDIFF (Member) / BHHUDIFF (All, batch)\par
- CHG01#NN - add entries for new trip\par
- DEL01#NN - add entries for new trip\par
- $$$INDEX - add entries for new LLxx/LSxx/LTxx\par
- $$$INDEZ - add entries for new LLxx/LSxx/LTxx\par
}}
If you load the .RTF in Macro$atan's Word and save it without even touching it, this one will more than quadruple in size, by filling it with truckloads of completely unnecessary tags. The essential one in this file are the first four, the RTF header, font table and dimensions, a \par tag at the end of each paragraph (or a \page) and text enclosed in {\b ... } groups to be bolded. (or {\i to... italicize, {\b\u\ to bold and underline.
Creating this kind of very simple files on the mainframe is a doddle, if you don't require any formatting, just plonk the first five lines at the top of your text, a \par at the end of each line and '}}' at the end. Transfer to the PC and you've got a valid .RTF document. Experiment with other small RTF documents to see how to change fonts, text sizes etc.
Joined: 07 Feb 2009 Posts: 1314 Location: Vilnius, Lithuania
Creating something that loads into a spreadsheet is either very simple, just separate your columns with ',' or whatever your locale considers the 'c' in csv and load it into any program that handles these things.
However, it is a not very well known fact that Macro$atan's product can also load CSV files with embedded formulae. To create one of these files, you will have to keep track of columns (and if you want to make matters really complex, rows). Here is a short example I found. I no longer have the file it operated on, but by creating a file with the necessary element at the positions this piece of code does it's substr's might give you some clues.
Code:
/* REXX */
arg infile
"alloc f(in) da("infile") shr reu"
'execio * diskr in ( stem in. finis'
"free f(in)"
Don't ask me how this worked, I wrote it in 2003, as an Q&D help for an analyst who wanted to verify some conversion output. In a more elaborate version I once wrote years earlier I actually converted packed numerical values to readable ones, code for that is something like
Thanks for your reply.
But I have a small request I am not able to understand the exact idea of your given example even the terms used by you like( RTF documents,TEXT editor, .RTF in Macro$atan's Word) are not very much clear to me. As I am beginner so if you can explain me in a bit easier way it will be helpful for me.
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
RTF is "rich text format" it is a data formatting protocol that is supported by many Windows applications (like e-mail and the ms-office products). If you are working on a mainframe via a 3270-type terminal connection (which is the most likely), you cannot use data in rich text format). The typically 24x80 screen uses one standard character per position and is not selectable within the data.
A TEXT editor is a program that allow the user to edit text data (notepad is a text editor). So is EDIT in tso/ispf.
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hi O,
Quote:
As prino said, converting a textual dataset to RTF is pertty easy.
yup, it is. Similar to embedding pcl escape sequences in a report so that a form can be generated "on the fly" from the mainframe. I'd not do either if this was the first attempt to download data and use it cross-platform.
I just wanted to make sure that Deepak understood that the rtf formatted data would not be visable on the mainframe screen.
Thanks Dick for giving explanation of the terns but my problem is still unresolved.
I have to create a code on RExx which can serve the purpose of transferring a piece of code present on host or mainframe to a .txt file(as a from of back-up).
The above example given by Prino is not clear to me. It will be help if anyone of you can provide me the algorithm, how to proceed?
What are things required when you are making a tool on Rexx.An exaple will solve the purpose.
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
deepak khera wrote:
What are things required when you are making a tool on Rexx.
It would help if you would outline your intended process specifically. What is the process flow? What are the input and output? What environments are involved? Where will the process execute? Are you using existing commands and programs and utilities, or is this something new that you're designing from scratch?
Your stated objective:
Quote:
I have to create a code on RExx which can serve the purpose of transferring a piece of code present on host or mainframe to a .txt file(as a from of back-up).
Joined: 07 Feb 2009 Posts: 1314 Location: Vilnius, Lithuania
deepak khera wrote:
olved.
I have to create a code on RExx which can serve the purpose of transferring a piece of code present on host or mainframe to a .txt file(as a from of back-up).
Making backup files from mainframe data sets on a PC, wow, can you please tell us the brand of PC, I never though I'd see the day when PCs became more reliable than mainframes...
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
Quote:
I have to create a code on RExx which can serve the purpose of transferring a piece of code present on host or mainframe to a .txt file(as a from of back-up).
That is what you've chosen as the solution to your requirement. If you post the actual requirement (rather than a possible solution) someone may have an alternative to suggest.
In general there are 3 "pieces" needed to do what you want.
1 - from the full mainframe data (database, vsam, other file) create a file to download. This might be text only or text with delimiters. It will contain no binary or packed decimal data - only text.
2 - transfer the file fro the mainframe to the destination (typically ftp or ndm). EBCDIC to ASCII conversion should be automatic.
3 - read/import the downloaded file into the pc application.
[I have to create a code on RExx which can serve the purpose of transferring a piece of code present on host or mainframe to a .txt file(as a from of back-up).
]
I don't think you need a REXX tool to transfer few hundred souce files from a minframe to PC. I thing you can do it manually using group FTP ('mget'). [/quote]
I make my question more specific, I want to prepare a tool on REXX which has following requirements
1) It should be able to transfer, suppose, a cobol code present in a member of a PDS to a notepad(plain).
2) It will run in mainframe environment. OS is Z/OS.
I thought of this idea as I used to follow process in which I used to go through command 6 of ISPF menu and then from the option menu I do batch transfer files and then provide the source(host) and destination(desktop or any drive on PC) address and other requisite. I found it to be lenghty proess so thought making it easier by making a tool. Please see the above attchement.I was not sure how to proceed so I thought of taking help from you people.
I would like to answer to Prino surprise, my purpose of mentioning word "back-up" is just for refernece.[/u]
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
If you want to take some existing source members from a pds on the mainframe, the easiest way to do this is to use the tcp/ip software already installed on your desktop.
You would use the ftp function, log onto the mainframe, change directory into the pds (a pds may be viewed as a directory in ftp) for the remote file, change into the local directory where you want to store the files, click/select some or all of the members you want to download, and download.
You will not want to try to write code on the mainframe to "send" the files to your desktop via ftp. Your desktop is not set up as an ftp server (most likely) and to send files from the mainfrme, the mainframe process must connect to an ftp server. Your desktop is most likely a client rather than a server.
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
Quote:
need some clarification on "tcp/ip software". I didnot understand, which software u are referring to.
It is most likely that your mainframe terminal eumlator is connceted to the mainframe via tcp/ip.
If you are not sure of how things are connected in your environment, you should talk with your desktop or network support people to learn what is available on your system.
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
Deepak had said:
Quote:
I used to go through command 6 of ISPF menu and then from the option menu I do batch transfer files and then provide the source(host) and destination(desktop or any drive on PC) address and other requisite.
It is not clear what he refers to, but does not sound like the normal FTP.
You may be able to do what you want by utilizing ISPF's WSA client, which you can download from ISPF option 3.7. After starting WSA, then from rexx, you can use:
1. WSCON service to connect to WSA
2. EDIT WSFN(ws-filename) MACRO(mymac) to open a new workstation file. Do #2 in a loop to get all of your files.
3. write a 'mymac' editor macro that copies from z/OS file and saves and exits.
4. WSDISCON
This will work for a small number of files, but I do not recommend for larger numbers.
The benefit of this approach is that you do not need an FTP server on your workstation and that you can run the process from the z/OS side.
Warning: if you are doing this for backup purposes, you also need to have a process in place to recover a dataset from a backup copy.