Standalone Routine to send mail !
Posted: Tue Apr 22, 2008 1:50 am
Hi All,
I am having a requirement in my sequencer wherein I need to send a mail to the desired recepient. The mail has to be in the form of a standlaone routine. I have a routine which rejects records and sends them as mail by taking the required parameters. I am not sure as to where to make changes in this code to make it a standlone routine. Please help me out in this regard. The code for the mail of rejected records is as follows :
#INCLUDE DSINCLUDE JOBCONTROL.H
#INCLUDE DSINCLUDE DSJ_XFUNCS.H
*---- getting Job Name-------------*
* strJobName = DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
* Call DSLogInfo("Job Name (strJobName) :":strJobName, DSJ.ME)
* strWorking = DSGetParamInfo(DSJ.ME,"$HMK_DIRWORKING", DSJ.PARAMVALUE)
* Call DSLogInfo("Working Directory (strWorking) :":strWorking, DSJ.ME)
*------Getting the Mail Information---------*
* FROM_MAILID = DSGetParamInfo(DSJ.ME, "JPM_FROM_MAILID", DSJ.PARAMVALUE)
* TO_MAILID=DSGetParamInfo(DSJ.ME, "JPM_TO_MAILID", DSJ.PARAMVALUE)
* SUBJECT=DSGetParamInfo(DSJ.ME, "JPM_SUBJECT", DSJ.PARAMVALUE)
* BODY=DSGetParamInfo(DSJ.ME, "JPM_BODY", DSJ.PARAMVALUE)
FROM_MAILID = "JPM_FROM_MAILID"
TO_MAILID="JPM_TO_MAILID"
SUBJECT="Gelco Web Reply File Output"
*-----------Sending Mail If Row Count In the Reject Link is Greater Than 0----------------------------*
CALL DSExecute("UNIX", "cat JPM_DIR_WORKING/xx.txt", ScreenOutput, ReturnCode)
Result= DSSendMail("From:":FROM_MAILID:"\nTo:":TO_MAILID:"\nSubject:":SUBJECT:"\nBody:":ScreenOutput)
ErrorCode = 0 ;
Any Help in this regard will be highly appreciated.
Thanks and Regards,
Chandru
I am having a requirement in my sequencer wherein I need to send a mail to the desired recepient. The mail has to be in the form of a standlaone routine. I have a routine which rejects records and sends them as mail by taking the required parameters. I am not sure as to where to make changes in this code to make it a standlone routine. Please help me out in this regard. The code for the mail of rejected records is as follows :
#INCLUDE DSINCLUDE JOBCONTROL.H
#INCLUDE DSINCLUDE DSJ_XFUNCS.H
*---- getting Job Name-------------*
* strJobName = DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
* Call DSLogInfo("Job Name (strJobName) :":strJobName, DSJ.ME)
* strWorking = DSGetParamInfo(DSJ.ME,"$HMK_DIRWORKING", DSJ.PARAMVALUE)
* Call DSLogInfo("Working Directory (strWorking) :":strWorking, DSJ.ME)
*------Getting the Mail Information---------*
* FROM_MAILID = DSGetParamInfo(DSJ.ME, "JPM_FROM_MAILID", DSJ.PARAMVALUE)
* TO_MAILID=DSGetParamInfo(DSJ.ME, "JPM_TO_MAILID", DSJ.PARAMVALUE)
* SUBJECT=DSGetParamInfo(DSJ.ME, "JPM_SUBJECT", DSJ.PARAMVALUE)
* BODY=DSGetParamInfo(DSJ.ME, "JPM_BODY", DSJ.PARAMVALUE)
FROM_MAILID = "JPM_FROM_MAILID"
TO_MAILID="JPM_TO_MAILID"
SUBJECT="Gelco Web Reply File Output"
*-----------Sending Mail If Row Count In the Reject Link is Greater Than 0----------------------------*
CALL DSExecute("UNIX", "cat JPM_DIR_WORKING/xx.txt", ScreenOutput, ReturnCode)
Result= DSSendMail("From:":FROM_MAILID:"\nTo:":TO_MAILID:"\nSubject:":SUBJECT:"\nBody:":ScreenOutput)
ErrorCode = 0 ;
Any Help in this regard will be highly appreciated.
Thanks and Regards,
Chandru