Home > AS/400 Tips > iSeries programmer tips > Improve old iSeries communication methods
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES PROGRAMMER TIPS

Improve old iSeries communication methods


Tim Granatir, Search400.com expert
01.28.2004
Rating: -3.29- (out of 5)


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


The iSeries has come a long way in its ability to handle communications. Although it handles IP communications well, there are a lot of synchronous modems still in existence and a lot of SDLC dial-up connections still around. If you're using one of those methods, then this tip is for you.

This is a command built around a file transfer API. This works well for transferring files over an SDLC connection and is faster than using SNADS or DDM. It's also an easy way to transfer files on the fly. Once you have a connection established, you can then use this command to do the rest.


Tim Granatir

A couple notes about this command. The remoteloc parameter can be found by doing DSPNETA on the remote system. That command assumes that the user name you are signed on with also exists on the remote system. Given a choice, I much prefer IP connections and FTP. But if you have to do an SDLC connection, then this works pretty well.

   CMD        PROMPT('Start File Transfer Support')             
             PARM       KWD(REMOTELOC) TYPE(*CHAR) LEN(10) MIN(1) +       
                          PROMPT('Target system name')                         
             PARM       KWD(OPTION) TYPE(*CHAR) LEN(1) MIN(1) +           
                          CHOICE('S, R') PROMPT('(S)end or (R)eceive)')   
             PARM       KWD(FROMFILE) TYPE(QUAL1) MIN(1) +                
                          PROMPT('From file')                             
             PARM       KWD(FROMMBR) TYPE(*CHAR) LEN(10) MIN(1) +         
                          PROMPT('From member')                           
             PARM       KWD(TOFILE)  TYPE(QUAL2) MIN(1) +                 
                          PROMPT('To file')                               
             PARM       KWD(TOMBR) TYPE(*CHAR) LEN(10) DFT(*FROMMBR) +    
                          SPCVAL((*FROMMBR *FROMMBR)) MIN(0) +            
                          PROMPT('To member')                             
             PARM       KWD(REPLACE) TYPE(*CHAR) LEN(8) RSTD(*YES) +      
                          DFT(*REPLACE) VALUES(*REPLACE *ADD) +           
                          SPCVAL((*REPLACE Y) (*ADD N)) +                 
                          CHOICE('*REPLACE, *ADD') PROMPT('Replace +      
                          or add records')                                
             PARM       KWD(PASSWORD) TYPE(*CHAR) LEN(10) MIN(1) +        
                          PROMPT('Password for remote system')            
 QUAL1:      QUAL       TYPE(*NAME) LEN(10)                               
             QUAL       TYPE(*NAME) LEN(10) PROMPT('Library name')        
 QUAL2:      QUAL       TYPE(*NAME) LEN(10)   
 QUAL       TYPE(*NAME) LEN(10) PROMPT('Library name') 


             PGM        PARM(&RMTLOCNAME &OPTION &FROMFL &FROMMBR &TOFL +   
                          &TOMBR &REPLACE &PASSWORD)                        
                                                                            
             DCL        VAR(&OPTION)   TYPE(*CHAR) LEN(1)                   
             DCL        VAR(&FROMLIB)  TYPE(*CHAR) LEN(10)                  
             DCL        VAR(&FROMFL  ) TYPE(*CHAR) LEN(20)                  
             DCL        VAR(&FROMFILE) TYPE(*CHAR) LEN(10)                  
             DCL        VAR(&FROMMBR)  TYPE(*CHAR) LEN(10)                  
             DCL        VAR(&TYPE   )  TYPE(*CHAR) LEN(6)                   
             DCL        VAR(&TOFL    ) TYPE(*CHAR) LEN(20)                  
             DCL        VAR(&TOLIB  )  TYPE(*CHAR) LEN(10)                  
             DCL        VAR(&TOFILE )  TYPE(*CHAR) LEN(10)                  
             DCL        VAR(&TOMBR  )  TYPE(*CHAR) LEN(10)                  
             DCL        VAR(&TODATE )  TYPE(*CHAR) LEN(6)                   
             DCL        VAR(&REPLACE)  TYPE(*CHAR) LEN(1)                   
             DCL        VAR(&RMTLOCNAME) TYPE(*CHAR) LEN(10)                
             DCL        VAR(&PASSWORD) TYPE(*CHAR) LEN(10)                  
             DCL        VAR(&RTNCODE)  TYPE(*CHAR) LEN(1)                   
             DCL        VAR(&MESSAGE)  TYPE(*CHAR) LEN(8)                   
             DCL        VAR(&RTC) TYPE(*CHAR) LEN(1)                        
                                                                            
             IF         COND(&TOMBR = '*FROMMBR') THEN(CHGVAR +             
                          VAR(&TOMBR) VALUE(&FROMMBR))                      
                                                                            
             CHGVAR     VAR(&FROMFILE) VALUE(%SST(&FROMFL 1  10))           
             CHGVAR     VAR(&FROMLIB ) VALUE(%SST(&FROMFL 11 10))           
                                                                            
             CHGVAR     VAR(&TOFILE  ) VALUE(%SST(&TOFL   1  10))           
             CHGVAR     VAR(&TOLIB   ) VALUE(%SST(&TOFL   11 10))           
                                                                            
             CALL       QY2FTML PARM(&OPTION &FROMLIB &FROMFILE +           
                          &FROMMBR &TYPE &TOLIB &TOFILE &TOMBR +            
                          &TODATE &REPLACE &RMTLOCNAME &PASSWORD +          
                          &RTNCODE &MESSAGE)                                
                                                                            
             IF         (&RTNCODE = '0') THEN(DO)                           
               SNDPGMMSG  MSG('File Transfer completed normally.')          
               GOTO       ENDPGM                                            
             ENDDO                                                          
             IF         (&RTNCODE = '1') THEN(DO)                           
               SNDPGMMSG  MSG('File Transfer ended abnormally because +     
                            of error on local system. Message ID' +         
                            *bcat &message)                                 
               GOTO       ENDPGM                                            
             ENDDO                                                          
                                                                            
             IF         (&RTNCODE = '2') THEN(DO) 
              SNDPGMMSG  MSG('File Transfer ended abnormally because +     
                           of error on remote system. Message ID' +        
                           *bcat &message)                                 
              GOTO       ENDPGM                                            
            ENDDO                                                          
ENDPGM:     ENDPGM                                                                                                               
                                                                          

---------------------------
About the author: Tim is vice president of Technical Services at Interlink Technologies in Maumee, Ohio, where he serves as chief architect for their warehouse management system. He has worked in the banking, insurance, healthcare and distribution industries in various positions, including programmer/analyst, systems analyst and DP manager. Tim has worked on IBM midrange platforms since 1983.

==================================
MORE INFORMATION
==================================

  • Setting up a dial-up connection
    This user needed to set up a dial-up connection to a credit-card processing company from their iSeries to send/receive transaction files using FTP daily. The problem was the credit-card company does not support a PPP line, so it has to be a regular dial-up connection (56k). How will the FTP process know to go over the line and not through our Internet connection? Site expert Tim Granatir had some advice.
  • Set up a dial-in line to an iSeries
    Frank was trying to set up a dial-in line through a phone line to an iSeries. However, when he tries to dial in from home, the modem doesn't respond and the iSeries doesn't respond to the modem. What was he doing wrong? Site expert Tim Granatir helped him sort it out.
  • Connect two servers using finance communications
    Is it possible o have two servers connected using finance communications? Yes, says site expert John Brandt, and he tells you how.


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




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



RELATED CONTENT
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

Application Development
iSeries calling an .exe
Top 10 programmer tips
Formatted work job scheduler
Convert system date and time
Mixing free format code with embedded SQL
SQL update a field in one file from a field in another file
Webcasts for iSeries programmers
Programming advice from the pros
Easy code copying via the drag and drop method
Setting FTP time-outs

PC/Windows Connectivity
CA Express utility helps you manage SSL certificates
Windows XP SP2 causes problem for iSeries Access
Top 10 tips from our experts
The registration facility helps you tailor your system -- Part II
20 FTP tips in 20 minutes
Are your terminal sessions secure?
Top advice on connecting to the iSeries
Fast guide to PC/Windows connectivity resources
The Lazy Coder: Find your iSeries using a DNS or name server
The Lazy Coder: Fun with TCP/IP

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

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
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