Hello,
I have to write telnet comands to send email
I suspect that you won't use telnet in jcl. . .
There are multiple ways to send an e-mail from a batch job (jcl). I'd suppgest you talk with the system support or network people an ask how to do this on your system.
Following is one simple way to send an e-mail:
//*=========================================
//** SENDS E-MAIL DURING EXCEPTIONS **
//*=========================================
//SENDNOTE EXEC PGM=IEBGENER,COND=(99,NE,STEP00X) - or whatever works for you
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSUT1 DD DSN=LIBNAME(MWMAILHR),DISP=SHR - e-mail "header" info
// DD DSN=NEWFILENAME(+1),DISP=SHR
// DD DSN=LIBNAME(MWMAILTR),DISP=SHR - e-mail "trailer" info
//*