Home > Ask the AS/400 Experts > iSeries Application Development Questions & Answers > Formatting the TOINTNET parameter
Ask The iSeries 400 Expert: Questions & Answers
EMAIL THIS

Formatting the TOINTNET parameter

Tim Granatir EXPERT RESPONSE FROM: Tim Granatir

Pose a Question
Other iSeries 400 Categories
Meet all iSeries 400 Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 21 August 2001
I have a CLP which calls an RPG program to format the recipient list, subject line and text of an e-mail message. Then, the RPG program passes this data back to the CLP, which uses it to build and execute the SNDDST command. If my recipient list contains more than one internet user ID, the e-mail address values get enclosed in quotes on the TOINTNET parameter of the SNDDST command. This causes the message to be non-deliverable. I've tried formatting the recipient list to where there are no embedded blanks. I've tried separating the e-mail addresses with a semi-colon. Also enclosing each address in parentheses, which is how it appears if I manually type the command and execute it. If I'm only sending the message to a single e-mail address, it works fine.

Does anyone have any idea how this TOINTNET parameter should be formatted? I think if I could just get the CLP to not enclose the passed address list in quotes, it would work.


>

When you try to execute a command in a CL program and that command has an unknown number of parameters, you usually have to execute that command using the QCMDEXC API. Following is a program that accepts a message and a message description. The program will then send that message to multiple e-mail addresses that are contained in a file by building the command in the CL program.

 
/*   ***********************************************************
/*   SEND E-MAIL TO MULTIPLE E-MAIL ADDRESSES                           
/*   ***********************************************************
             PGM        PARM(&MSG &DESC)                                
                                                                        
             DCLF       FILE(EMAILIDS)                                  
             DCL        VAR(&DESC) TYPE(*CHAR) LEN(20)                  
             DCL        VAR(&MSG) TYPE(*CHAR) LEN(20)                   
             DCL        VAR(&CMDLEN) TYPE(*DEC) LEN(15 5) VALUE(2500)   
             DCL        VAR(&CMD) TYPE(*CHAR) LEN(2500)                 
             DCL        VAR(&BLANKSTR) TYPE(*CHAR) LEN(2500)            
                                                                        
 BEGIN:                                                                 
/*  CLEAR OUT VARIABLES                                              */ 
             CHGVAR     VAR(&CMD) VALUE(&BLANKSTR)                      
                                                                        
 BUILD:                                                                 
/*  BUILD THE FIRST PART OF  THE COMMAND STRING                             */ 
             CHGVAR     VAR(&CMD) VALUE('SNDDST TYPE(*LMSG) +           
                          TOINTNET(')     
                                                                        
READ:                                                                   
/*  ADD ALL E-MAIL ADDRESSES TO RECIPIENT LIST                       */ 
             RCVF                                                       
             MONMSG     MSGID(CPF0864) EXEC(GOTO CMDLBL(FINISH))        
             CHGVAR     VAR(&CMD) VALUE(&CMD *TCAT '(' *TCAT &NAME +    
                          *TCAT ') ')                                   
             GOTO READ                                                  
                                                                        
 FINISH:                                                                
/*  CLOSE E-MAIL ADDRESS PARM                                           */ 
             CHGVAR     VAR(&CMD) VALUE(&CMD *TCAT ')')                 
                                                                        
/*  ADD DESCRIPTION & MESSAGE (ENCLOSE THEM IN QUOTES)               */ 
             CHGVAR     VAR(&CMD) VALUE(&CMD *BCAT 'DSTD(' *TCAT +      
                          '''' *TCAT &DESC *TCAT '''' *TCAT ') ')       
             CHGVAR     VAR(&CMD) VALUE(&CMD *BCAT 'LONGMSG(' *TCAT +   
                          '''' *TCAT &MSG *TCAT '''' *TCAT ') ')        
                                                                        
/*  EXECUTE THE COMMAND                                            */   
             CALL       PGM(QCMDEXC) PARM(&CMD &CMDLEN)      
                        
 ENDPGM:     ENDPGM     

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
iSeries Application Development
Monitoring escape messages and using RCVMSG for diagnostic messages
Listing contents of multiple FTP directories on AS/400
Chain operation error after converting RPG3 to ILE RPG (RPGIV)
Space offset X'0015FF00' or X'0000000000000000' is outside current limit for object QIGC2424C
Searching fields for values
iSeries application display subfiles with other program windows
Searching part of a name or address in AS/400
Passing parameters in an ILE RPG module
What's happening to my subfile?
What happening to my subfile?

iSeries CL programming
Taking advantage of CL advancements, starting with V5R3
Checking in on your IBM i authorization lists
Running PHP open source applications: NOBODY needs authority
Simplify the process of converting a spool file from iSeries into an Excel spreadsheet
CL program for daily backups
An automated CL method of moving a query from AS/400 to Excel
Changing user password expiration
Eight steps for creating program documentation using AS/400 utilities
DAYSPAST CLLE program for AS/400: Compares object creation date with today's date
Advanced Job Scheduler help

iSeries COBOL programming
Implementing a browser interface in COBOL: Displaying database fields
Implementing a browser interface in COBOL: Creating your graphic Web page
Implementing a browser interface in COBOL: Getting started
Allow access to data from a stored procedure result set using COBOL or RPG
Eight steps for creating program documentation using AS/400 utilities
Coloring source lines with COBOL and using a shortcut from within PDM
Top 10 programmer tips YTD
Slow system performance
Changing the font size
New option within the WRKSYSACT command
iSeries COBOL programming Research

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



iSeries Networking - Printing, Remote Access, TCP/IP
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts