MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sending email - SAS question

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
Declan
Beginner


Joined: 04 May 2005
Posts: 15
Topics: 8

PostPosted: Wed Jan 18, 2006 4:54 am    Post subject: Sending email - SAS question Reply with quote

Hi there,

I've found some very useful information in these forums on sending emails from the mainframe.

The company I work for will not allow us to send externally using REXX and SMTP, however I've found that using SAS will allow mails to be sent externally.

The file I want to send is 2004 bytes in length. The SAS I have used to send it is the following:

Code:

//SAS2     EXEC  SAS,
//         OPTIONS='EMAILHOST=smtp.mycompany.com'
//STEPLIB  DD
//         DD DSN=XXXX.SASP.LIBRARY.NEW,DISP=SHR
FILENAME MYMAIL EMAIL ('DECLAN@MYCOMPANY.COM')
         SUBJECT='YOUR PRINT OUTPUT'
         FROM='COMPANY@MYCOMPANY.COM'
         ATTACH=("THE.FILE.I.WANT.TO.ATTACH"
                  EXTENSION='dat'
                  CONTENT_TYPE="TEXT/PLAIN");
DATA _NULL_;
  FILE MYMAIL;
  PUT '    ';
  PUT 'TEST';
  RUN;
/*


The mail sends successfully - but when I open the attachment in Notepad, Wordpad and Internet Explorer - all 2004 bytes of data are spread across 3 lines.

Is there any way of changing the SAS so that all 2004 bytes are displayed on one line?

Many thanks in advance Smile
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jan 18, 2006 5:05 am    Post subject: Reply with quote

Declan,

Click on FORMAT in notepad tab and unclick "word wrap" and you will just see 1 line of data.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Declan
Beginner


Joined: 04 May 2005
Posts: 15
Topics: 8

PostPosted: Wed Jan 18, 2006 6:01 am    Post subject: Reply with quote

Hi Kolusu,

Thanks for your reply.
Unfortunately your suggestion does not work.

Is there any changes that can be made to the SAS so that when the recipient opens the email attachment, all 2004 bytes will be on one line?

Thanks
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Wed Jan 18, 2006 6:10 am    Post subject: Reply with quote

Declan, could you post a copy of a hex dump of the first record of the file as it appears on the recipient's email system?
Back to top
View user's profile Send private message
Declan
Beginner


Joined: 04 May 2005
Posts: 15
Topics: 8

PostPosted: Wed Jan 18, 2006 6:18 am    Post subject: Reply with quote

Hi superk,

This is highly sensitive and confidential information.

What would you hope to see or determine from a hex dump?

Declan
Back to top
View user's profile Send private message
advoss
Beginner


Joined: 23 Aug 2005
Posts: 26
Topics: 0

PostPosted: Wed Jan 18, 2006 10:45 am    Post subject: Reply with quote

What is the LRECL of your attached file (and other DCB parameters)? An alternative might be to convert it to ASCII and send it as a binary file.
_________________
Alan Voss
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Wed Jan 18, 2006 10:51 am    Post subject: Reply with quote

Declan wrote:
What would you hope to see or determine from a hex dump?

I was thinking that it would be useful to know if the data does indeed contain record delimiters (CR/LF pairs). A quick test shows that it indeed does have more than just the one set of CR/LF pairs per 2004-byte record.

A test using a non-SAS method of attaching the same file did not contain any extra CR/LF characters, so it looks like it's a SAS issue. I didn't find anything on their web sites stating that there are any restrictions on the length of the file attachment.

I was going to make the same suggestion as advoss, or suggest that maybe you might want to take this issue up with SAS.
Back to top
View user's profile Send private message
advoss
Beginner


Joined: 23 Aug 2005
Posts: 26
Topics: 0

PostPosted: Wed Jan 18, 2006 3:58 pm    Post subject: Reply with quote

Superk, I think that you will find that "assumptions" are made when SAS translates from EBCDIC to ASCII to satisfy the CONTENT_TYPE="TEXT/PLAIN" option. In such cases, I try to translate to ASCII and then send as CONTENT_TYPE="image/gif". I know, it isn't an image file, but, bottom line, it treats it like a binary file and doesn't "help" me.
_________________
Alan Voss
Back to top
View user's profile Send private message
Declan
Beginner


Joined: 04 May 2005
Posts: 15
Topics: 8

PostPosted: Thu Jan 19, 2006 8:50 am    Post subject: Reply with quote

Thanks for the input guys.

Can you possibly tell me how to convert EBCDIC to ASCII? Is it a command that must be added to the SAS?
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Thu Jan 19, 2006 9:22 am    Post subject: Reply with quote

It can be:
Code:

//...
//TLIST    DD   DSN=THE.FILE.I.WANT.TO.ATTACH,
//         DISP=SHR                     
//TLISTO   DD   DSN=THE.FILE.I.WANT.TO.ATTACH.ASCII,
//         DISP=(,CATLG,DELETE),   
//         UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE),                       
//         RECFM=FB,LRECL=2004                                     
//SYSIN    DD   DATA                                               
  DATA _NULL_;                                                     
  INFILE TLIST;                                                     
  FILE TLISTO;                                                     
  INPUT @1 LINE1 $CHAR2004.;                                       
  PUT @1 LINE1 $ASCII2004.;                                         
  RUN;                                                             
Back to top
View user's profile Send private message
Declan
Beginner


Joined: 04 May 2005
Posts: 15
Topics: 8

PostPosted: Mon Jan 30, 2006 10:24 am    Post subject: Reply with quote

Hi guys - I had a search through the SAS website and found that there is a problem with SAS and files with long record lengths.

SAS breaks longer records down into blocks of 990 bytes. My record contains 2004 bytes - therefore the 1st line of data would stop at byte 990, the 2nd line of data would stop at byte 1980, then I get a 3rd line of data for the remaining 24 bytes.

So it is a limitation of SAS.

Back to the drawing board!
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Mon Jan 30, 2006 10:54 am    Post subject: Reply with quote

Declan, thanks for the information.
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group