Page 1 of 1

Syntax Error in sending mail

PostPosted: Thu Apr 02, 2009 11:51 am
by manesg
Hi,

I tried the following program which was given by another member in this forum. I do get the mail in my mail box, but i get some errors. Can anyone let me know the correct syntax? (Iam giving below the mail program as well the output received in the mail box).


The Prgm
//MMAIL JOB (PS),'PS-MAIL',CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//S1 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSUT1 DD *
HELO ABC
MAIL FROM: <alex@gmail.com>
RCPT TO: <alex@gmail.com>
DATA
TO: <alex@gmail.com>
FROM: "Alex"<alex@gmail.com>
SUBJECT: HELLO
THIS IS A TEST MAIL.
//*
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,SMTP)
//*
__________
The Output (In my mail box)

Unable to deliver mail to some/all recipients.
050 DATA                                                                    00080003
501 Syntax Error. No Args after 'DATA' command
050 TO: <alex@gmail.com>                                           00090003
500 Unknown command, 'TO'
050 FROM: "Alex"<alex@gmail.com>                                   00100003
500 Unknown command, 'FROM'
050 SUBJECT: HELLO                                                          00110003
500 Unknown command, 'SUBJECT'
050 THIS IS A TEST MAIL.                                                    00120003
500 Unknown command, 'THIS'

           ** Text of Mail follows **
HELO ABC                                                                00050003
MAIL FROM: <alex@gmail.com>                                    00060005
RCPT TO: <alex@gmail.com>                                      00070005
DATA                                                           00080005
TO: <alex@gmail.com>                                           00090005
FROM: "Alex"<alex@gmail.com>                                   00100005
SUBJECT: HELLO                                                          00110003
THIS IS A TEST MAIL. 

________
The JCL however completed with RC=0.

thanks

Re: Syntax Error in sending mail

PostPosted: Thu Apr 02, 2009 4:05 pm
by MrSpock
What's with the numbers?

050 DATA 00080003
501 Syntax Error. No Args after 'DATA' command
050 TO: <alex@gmail.com> 00090003
500 Unknown command, 'TO'
050 FROM: "Alex"<alex@gmail.com> 00100003
500 Unknown command, 'FROM'
050 SUBJECT: HELLO 00110003
500 Unknown command, 'SUBJECT'
050 THIS IS A TEST MAIL. 00120003
500 Unknown command, 'THIS'

Re: Syntax Error in sending mail

PostPosted: Fri Apr 03, 2009 9:59 am
by manesg
Hi,

I dont know about those numbers too. Because that is what i got in the mail (in my mailbox).
I have just copied the whole stuff and done a paste here, so anyone would have come across this kind of mail.

The mail does say about syntax error. Is anything expected after the "DATA" word?
Even i removed the "DATA" word and entered another statement. But still i get the same error.

thanks

Re: Syntax Error in sending mail

PostPosted: Sat Apr 04, 2009 1:17 am
by dick scherrer
Hello,

Suggest you copy this
HELO ABC
MAIL FROM: <alex@gmail.com>
RCPT TO: <alex@gmail.com>
DATA
TO: <alex@gmail.com>
FROM: "Alex"<alex@gmail.com>
SUBJECT: HELLO
THIS IS A TEST MAIL
.
into a PS fb file with lrecl 80. Note the period on the last line. Use this PS as the SYSUT1 dataset.

It appears that line and/or sequence numbers may be in the input, which makes things invalid.

If this experiment works, you need to resolve the unwanted numbers in the current process.

Re: Syntax Error in sending mail

PostPosted: Mon Dec 09, 2013 6:14 am
by ravi-1183
Hi

Even after copy paste it didnt work through.

Getting same error message like manesg mentioned.

Tried sending simple mail below its works fine, but when i append it to any of the JCL, it throwing systax errors, Kindly assist me to get out of this error.

//MAILSTEP EXEC PGM=IEBGENER               
//SYSIN    DD DUMMY                       
//SYSPRINT DD SYSOUT=*                     
//SYSUT2   DD SYSOUT=(A,SMTP)             
//SYSUT1   DD *                           
HELO NODE
MAIL FROM:<xxxx.xxxxxxx@xxxxx.COM>   
RCPT TO:<xxxx.xxxxxxx@xxxxx.COM>     
DATA                                       
FROM:<xxxx.xxxxxxx@xxxxx.COM>       
TO:<xxxx.xxxxxxx@xxxxx.COM>         
SUBJECT: SUCCESSFULL
Mail notification SUCCESSFULL
.
//*

Re: Syntax Error in sending mail

PostPosted: Mon Dec 09, 2013 6:21 am
by dick scherrer
Hello and welcome to the forum,

When you have a new question that relates to some old, dormant topic, it is best to start a new to start a new topic and refer to the old topic.

but when i append it to any of the JCL,
How is this "appended"?

You need to post the actual job submitted (copy/paste - not rekeyed) along with the diagnostic information presented.

Re: Syntax Error in sending mail

PostPosted: Mon Dec 09, 2013 5:20 pm
by NicC
And it did NOT "throw" a syntax error, it GAVE a syntax error or "YOU GOT" a syntax error or it "FAILED" with a syntax error. Nothing on the mainframe "throws" anything unless it is running Java or C on USS.

Also, please learn to use the "code-tags". Plenty of references throughout the forum on how to do this. I have 'coded' the relevant part of your post and the original post in this topic.

Re: Syntax Error in sending mail

PostPosted: Mon Dec 09, 2013 5:34 pm
by Robert Sample
SMTP is independent of the platform. If the JCL you are appending this to has line numbers, and the SMTP commands pick up line numbers as a result, you WILL get syntax errors since SMTP sees the line numbers as part of its commands.