How to upload source member to the 400

page d'accueil
Boite à outils

Cette page a été mise à jour le 10 décembre 2009
Contact

Welcome page
Tools box

Versionning 

My RPG tools use some /COPY or /INCLUDE. They are all downloadables here : COPY used in my tools

Using the SAVF, 

to upload to your system, you just have to :

On the IBMi, create an empty save file : CRTSAVF QGPL/JPLTOOLS

On your PC:

start FTP (start / execute / cmd)

start FTP and run this script :

C:\Documents and Settings\User>ftp
ftp> open My400
Connecté à My400.
220-QTCP at AS400.My400.
220 Connection will close if idle more than 5 minutes.
Utilisateur (192.168.0.87:(none)) : YourUserAccount
331 Enter password.
Mot de passe : …..
230 My400 logged on.
ftp> bin

200 Representation type is binary IMAGE.
ftp>
cd /qsys.lib/qgpl.lib
250 "/QSYS.LIB/QGPL.LIB" is current library.
ftp>
lcd C:\MyFolder
Dossier locput jpltools.file jpltools.file

200 PORT subcommand request successful.n>
200 PORT subcommand request successful.
150 Sending file to member JPLTOOLS in file JPLTOOLS in library QGPL.
226 File transfer completed successfully.
ftp : 11111 octets envoyés en 1,11 secondes à 1111,11 Ko/sec.
ftp>
quit
221 QUIT subcommand received.
C:\Documents and Settings\User>exit
then, back to IBMi
Take care of authority : DSPSAVF qgpl/jpltools will say you
restore the SAVF : 
CRTLIB LIB(JPLTOOLS) TEXT(WWW.JPLAMONTRE.FREE.FR)
RSTOBJ OBJ(*ALL)
SAVLIB(LAMONTRE1)
DEV(*SAVF)
SAVF(JPL/JPLTOOLS)
ALWOBJDIF(*OWNER)
RSTLIB(JPLTOOLS)

Apply your security rules, for example
CHGOWN OBJ('/qsys.lib/jpltools.lib') NEWOWN(LAMONTRE) SUBTREE(*ALL)

 And take care to CCSID. This toolbox is by default in American CCSID (IE EBCDIC 37)

This is particularly true fior the source file.
To be able to read, modify or compile any program, I HIGHLY recommand to setup your job to the American context IE

something like that:

Configure PC 5250 CCSID

DSPJOB
2. Display job definition attributes  
then on third page:

Language identifier . . . . . . . . . . . . . . . :   ENU      
Country or region identifier  . . . . . . . . . . :   US        
Coded character set identifier  . . . . . . . . . :   37        
Default coded character set identifier  . . . . . :   37        
Character identifier control  . . . . . . . . . . :   *JOBCCSID 

 Change your job acording to these values

 

Using the source code members, you can :

 

 

You have code400 installed in your computer

You have the as400 or iSeries or SystemI5 disk shared, ie you can see it with the windows explorer

You have  iSeriesNavigator

Neither shared disk nor iSeries Navigator :

With ftp


ftp myas400
... myuser
... mypassword
ftp> cd jpltools
250 "JPLTOOLS" is current library.
ftp> lcd c:\temp
Dossier local maintenant C:\TEMP.
ftp> put sylk_h.txt qpgmsrc.sylh_h (replace
200 PORT subcommand request successful.
150 Sending file to member SYLH_H in file QPGMSRC in library JPLTOOLS.
250 File transfer completed successfully.
ftp : 35093 octets reçus dans 0,00Secondes 35093000,00Ko/sec.

It is possible to script the FTP run to transfert many files at the same time. But as I have a shared I5 directory, I uses drag & drop. I don't provide FTP scripts

 

FTP and naming convention

there is 2 naming conventions to get or put files on the I5, the QSYS naming and the IFS naming

When you type CD QGPL, you are using the QSYS name format

When you type CD /QSYS.LIB/QGPL.LIB, you are using the IFS name format.

To switch to QSYS name format, the FTPcommand is QUOTE SITE NAMEFMT 0

To switch to IFS name format, the FTPcommand is QUOTE SITE NAMEFMT 1

 

THE CCSID ISSUE : TRANSLATION ERRORS

 

If you encounter some translation errors For example, in my french source, @ is replaced by à, { by é, } by è, you can solve then with this indirect copy :

This tool is a free source text; you can redistribute it and/or modify it as much as you need. Just add as comment in the code a reference to this site : http://jplamontre.free.fr/jpltools.htm ... and send me an email Contactwith "jpltools" in the subject (it's for my antispam rules). I will be happy to know what you have done with the jpltools. This tool is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY :

THIS TOOLBOX IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PROVIDER OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS TOOLBOX, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.