IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Dataset becomes Text file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Thaise

New User


Joined: 19 Jan 2010
Posts: 3
Location: Brazil

PostPosted: Thu Jan 13, 2011 11:55 pm
Reply with quote

Hi
I need to change a sequential PDS file to TEXT (txt) file on JCL and then send it by e-mail.
Does anybody have any suggestion?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Jan 14, 2011 12:00 am
Reply with quote

There is no such thing as a text or .TXT file on the mainframe, and no such thing as a "sequential PDS file" anywhere. Please re-state your requirement.
Back to top
View user's profile Send private message
Thaise

New User


Joined: 19 Jan 2010
Posts: 3
Location: Brazil

PostPosted: Fri Jan 14, 2011 12:08 am
Reply with quote

I couldn't figure it out if I can make a text file on mainframe, because of it I have asked for you.
My file is not a VSAM file.
I believe if it is not a VSAM file, it is a sequential file.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Jan 14, 2011 12:20 am
Reply with quote

Quote:
I believe if it is not a VSAM file, it is a sequential file.
Your belief is wrong. There are sequential files, VSAM files, partitioned (PDS) files, and direct (BDAM) files -- and there have been other file types in the past.

What do you think the difference between a "text file" and a data set is on your mainframe? On a PC, a text file is one that has line delimiters -- but on a mainframe, data sets have records instead of line delimiters. Of course, on a mainframe under Unix System Services, files have line delimiters as well. Terminology is critical in IT, where similar terms may mean very different things. So what are you attempting to accomplish?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Jan 14, 2011 12:24 am
Reply with quote

Thaise wrote:
I couldn't figure it out if I can make a text file on mainframe, because of it I have asked for you.
My file is not a VSAM file.
I believe if it is not a VSAM file, it is a sequential file.

Your belief is incorrect. Aside from various sorts of data sets that are primarily of historical interest today, the partitioned data set (PDS) is very much in use. You will readily see why referring to a "sequential PDS file" is hopelessly confusing.

Now, if you have a physical sequential (PS) data set, and you are copying the contents into the body of your e-mail, no conversion is necessary. If you intend to send it as an attachment, you may have to convert from EBCDIC to AASCII yourself; this is a point on which I am uncertain, not having attempted it myself. If you search these fora for "SMTP", giving Robert Sample or superk, I believe that you will find some truly expert advice.
Back to top
View user's profile Send private message
Thaise

New User


Joined: 19 Jan 2010
Posts: 3
Location: Brazil

PostPosted: Fri Jan 14, 2011 12:28 am
Reply with quote

I just wanted to know if I can generate .txt files on mainframe thru sequential files, and then, send them by e-mail.
But I guess it is not possible =/
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Jan 14, 2011 12:50 am
Reply with quote

Thaise wrote:
I just wanted to know if I can generate .txt files on mainframe thru sequential files, and then, send them by e-mail.
But I guess it is not possible =/

12.gif You didn't actually bother to read anything that Mr. Sample or I wrote, did you?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jan 14, 2011 12:53 am
Reply with quote

Hello,

Quote:
But I guess it is not possible
Bad guess. . .

You are hung up in the term ".txt file" which does not exist on the mainframe.

Actually if you have a sequential file or a member in a pds, these can be downloaded directly (provided the content is actually text and not binary or packed-decimal numbers or some other non-text content such as an image).

Simply ftp the data to your target system and use it. . .
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Jan 14, 2011 1:02 am
Reply with quote

I email files that are .txt from the mainframe to people with PC's every day. Once the SMTP is set up correctly for an attachment, you can send .txt files or .zip files or whatever is generated on your mainframe.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Jan 14, 2011 1:04 am
Reply with quote

Quote:
If you search these fora for "SMTP", giving Robert Sample or superk, I believe that you will find some truly expert advice.

Akatsukami, thanks for the kind words!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jan 14, 2011 2:25 am
Reply with quote

Quote:
Simply ftp the data to your target system and use it. . .


Sorry 'bout that - i got so carried away with the complete disregard for info posted that i mentioned the wrong transfer method. . . icon_redface.gif

d
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Jan 14, 2011 3:50 pm
Reply with quote

You could also try


Code:
//MAILSTPC EXEC PGM=IEBGENER,COND=(4,LT)       
//SYSPRINT DD SYSOUT=*                         
//SYSUT1   DD DSN=WELLS.EMAIL.HEADER,DISP=SHR
//         DD DSN=WELLS.EMAIL.BODY,DISP=SHR 
//SYSUT2   DD SYSOUT=(B,SMTP)                        <---(B,SMTP) may vary on ur site, check with support group             
//SYSIN    DD *                               
/*



WELLS.EMAIL.HEADER should contain,
Code:
HELO SMTP                                             
MAIL FROM:<WELLS@XYZ.COM>               
RCPT TO: <YOUEMAILADDRESS@COMPANY.COM>             
DATA                                                 
FROM:     WELLS@XYZ.COM                 
TO:       YOUEMAILADDRESS@COMPANY.COM               
SUBJECT: Attached is the generated report             
MIME-VERSION: 1.0;                                   
CONTENT-TYPE: TEXT/RICH TEXT;                         
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=SOMENAME.TXT



WELLS.EMAIL.BODY is the PDS member or PS file which you are trying to send as email attachment.

As you may already know WELLS.EMAIL.HEADER & WELLS.EMAIL.BODY should have same dataset attributes like LRECL and stuff.

Hope it helps.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top