SQL2SYLK(outdated)

page d'accueil
Boite � outils

Cette page a été mise à jour le 14 septembre 2009
Contact

Welcome page
Tools box

Versioning :

outdated for years, replaced by SQL2XLS3

last version : The SaveFiles

Qu'est ce que le SYLK ? Le SYLK est un format texte qu'Excel comprend. C'est le format d'export de MULTIPLAN. Etant un format texte, il est "facile" à produire par un programme RPG. En tout cas, beaucoup plus facile que le format binaire d'excel. 

Produire un fichier AS400 lisible directement par Excel est donc à portée de main, sans logiciel supplémentaire ... à part le logiciel qui permet de voir les fichiers AS400 IFS depuis un PC.

  • Ce peut être Client Access (solution que j'utilise)
  • Ce peut être la copie directe par l'AS400 sur un serveur NT (sous-système de fichier QNTC), solution qui fonctionne plutôt bien.

Par rapport au système de transfert de fichier de Client Access, cet outil permet

  • de conserver le code SQL sur l'AS400 au lieu d'un fichier .DTF
  • de ne pas donner l'outil de transfert de fichiers aux utilisateurs, donc de reprendre autorité sur ce qui sort de l'AS400 ... ou de ce qui rentre

Cet outil utilisait beaucoup de /COPY différents, je les ai réintégrés dans le code pour en simplifier la distribution.

Cet outil sait exporter ces types de colonnes :

  • DECIMAL
  • NUMERIC
  • SMALLINT & INT (2, 4 & 8 octets)
  • DATE
  • TIME
  • TIMESTAMP
  • CHAR
  • VARCHAR
  • FLOAT (simple & double)
  • HEXA (debugging uniquement)
What is the SYLK ? The SYLK is a text format that Excel understands. It is the MULTIPLAN export format. Being a text format, it is "easy" to produce by an RPG program. In any case, a lot easier than the Excel binary format.

To produce an AS400 file directly readable by Excel is therefore at your hand, without supplementary software... but the software that permits to see the IFS AS400 files from a PC.

  • It can be Client Access (solution that I use) 
  • It can be the direct copy by the AS400 on an NT server (subsystem of QNTC file), solution that runs quite correctly. 

Unlike to the Client Access file transfer system, this tool permits 

  • to preserve the SQL code on the AS400 instead of in a .DTF  file
  • not to give the transfer tool to the users, therefore to take authority on what comes out of the AS400 ... or of what goes back

This tool used a lot of different /COPY, I restored them in the code to simplify the distribution of it. 

This tool knows how to export these types of columns: 

  • DECIMAL 
  • NUMERIC 
  • SMALLINT & INT (2, 4 & 8 bytes) 
  • DATE 
  • TIME 
  • TIMESTAMP 
  • CHAR
  • VARCHAR 
  • FLOAT (simple & double) 
  • HEXA (debugging only)
Exemple  sample
SQL2SYLK SQL('SELECT * FROM qadbifld WHERE DBILIB =''QSYS'' and DBIFIL =''QADBXREF''') sql2sylk.slk
STRDBG 
SQL2SYLK SQL('SELECT * FROM qadbifld WHERE DBILIB =''QSYS'' and DBIFIL =''QADBXREF''') IFSFILE('sql2sylkdebug.slk')sql2sylkdebug.slk
dans cet exemple, le code fournit aussi les entêtes de colonnes In this sample, the code provides also column heading

SQL2SYLK SQL('SELECT ORDNO "No OF", FITEM "Mod�le" , +
UUD1MY "No Serie", n7date(ODUDT) "Due +    
date", n7date(PCMDT) "Completed date", +   
n7date(pcmdt)- n7date(ODUDT) "�cart +      
calendaire", ORQTY "Quantit�", QTEOK "OK" +
FROM ...') +                            
IFSDIR('ManufacturingOrders') +            
IFSFILE('AccuracyDetail.slk') 
  an other sample based on qiws/qcustcdt : qcustcdt.slk and a snapshot with Open Office 2
 

 

  I am working on a Excel 2003 xml version wich will produce this file qcustcdt.xls

The source code is provided as an open source tool under the GNU General Public License, version 2.  In summary, this license specifies:

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.