Syntax Error in sending mail



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Syntax Error in sending mail

Postby manesg » Thu Apr 02, 2009 11:51 am

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
manesg
 
Posts: 22
Joined: Thu Jul 17, 2008 11:16 am
Has thanked: 0 time
Been thanked: 0 time

Re: Syntax Error in sending mail

Postby MrSpock » Thu Apr 02, 2009 4:05 pm

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'
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: Syntax Error in sending mail

Postby manesg » Fri Apr 03, 2009 9:59 am

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
manesg
 
Posts: 22
Joined: Thu Jul 17, 2008 11:16 am
Has thanked: 0 time
Been thanked: 0 time

Re: Syntax Error in sending mail

Postby dick scherrer » Sat Apr 04, 2009 1:17 am

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.
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

Re: Syntax Error in sending mail

Postby ravi-1183 » Mon Dec 09, 2013 6:14 am

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
.
//*
ravi-1183
 
Posts: 1
Joined: Sun Dec 08, 2013 5:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Syntax Error in sending mail

Postby dick scherrer » Mon Dec 09, 2013 6:21 am

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.
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

Re: Syntax Error in sending mail

Postby NicC » Mon Dec 09, 2013 5:20 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Syntax Error in sending mail

Postby Robert Sample » Mon Dec 09, 2013 5:34 pm

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.
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


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post