Thursday, February 12, 2015

AS400 and Columns Headers using SQL , References

Label On Command : http://publib.boulder.ibm.com/iseries/v5r1/ic2924/index.htm?info/db2/rbafzmstlabelon.htm

Describe Table http://publib.boulder.ibm.com/html/as400/v4r4/ic2924/info/db2/rbafzmst96.htm

DB2 Universal Database for iSeries SQL Reference : https://publib.boulder.ibm.com/iseries/v5r1/ic2924/index.htm?info/db2/rbafzmst103.htm

Appendix G. DB2 UDB for iSeries Catalog Views : https://publib.boulder.ibm.com/iseries/v5r1/ic2924/index.htm?info/db2/rbafzmst103.htm

AS400 Query Tool

DB2 UDB for AS/400 Query Management Programming


Table of Contents

About DB2 UDB for AS/400 Query Management Programming
  • Who Should Use This Book
  • What Query Management Does Not Do
  • AS/400 Operations Navigator
  • Installing Operations Navigator
  • Prerequisite and related information
  • How to send your comments
  • Chapter 1. Introduction
  • Query Management Overview
  • Query Management Enhancements
  • AS/400 and the SAA Environment
  • Collection Use by Query Management
  • Naming Conventions
  • Query Objects
  • System Naming
  • SAA Naming
  • AS/400 Objects
  • Variable Names
  • Other Query Names
  • Security and Authorization
  • Query Management Objects
  • Query Management CL Commands
  • Generic Commands
  • Message Descriptions
  • Chapter 2. Query Capability
  • Creating Queries
  • Creating Queries Example
  • Query Restrictions
  • Variable Substitution
  • Variable Prompting
  • Comments
  • Line Continuations
  • Using Sort Sequence with Queries
  • Chapter 3. Instance Processing
  • Creating a Query Management Instance
  • Running a Query Management Query
  • Global Variable Substitution
  • Creating Query Management Reports
  • Importing a Query or Form Object
  • Exporting a Query or Form Object
  • Importing and Exporting a Query Management Procedure
  • Running a Query Management Procedure
  • Using the Save Data As Command
  • Using SET GLOBAL and GET GLOBAL Commands
  • Introducing Activation Groups
  • Chapter 4. Commands
  • Specifying Commands and Keywords
  • Command Parsing
  • How to Read the Syntax Diagrams
  • COMMIT
  • Examples of the COMMIT Command
  • CONNECT
  • Parameter List
  • Examples of the CONNECT Command under RUW Connection Management
  • Examples of the CONNECT Command under DUW Connection Management
  • DISCONNECT
  • Examples of the DISCONNECT Command
  • ERASE
  • Parameter List
  • Examples of the ERASE command
  • EXIT
  • Examples of the EXIT command
  • EXPORT
  • Parameter List
  • CCSID Considerations
  • Examples of the EXPORT Command
  • GET
  • Examples of the GET Command
  • IMPORT
  • CCSID Considerations
  • Examples of the IMPORT Command
  • PRINT
  • CCSID Considerations
  • Examples of the PRINT Command
  • Printer File Use
  • Print Object Formatting
  • Print Report Formatting
  • RELEASE
  • Examples of the RELEASE Command
  • RUN
  • Run Command Considerations
  • Date Format Use
  • CCSID Use
  • CALL SQL Limitations
  • Examples of the RUN Command
  • SAVE
  • Examples of the SAVE Command
  • Null Value Considerations
  • Referential Constraint Considerations
  • Long Column Name Considerations
  • SET CONNECTION
  • Examples of the SET CONNECTION Command
  • SET GLOBAL
  • Examples of the SET GLOBAL Command
  • Quotation Marks in varname Values
  • Programming Considerations
  • START
  • Extended Parameter List
  • Examples of the START Command
  • Query Management Query Command Procedure
  • Example of the Query Management Command Procedure
  • CL Commands
  • ANZQRY (Analyze Query) Command
  • CRTQMFORM (Create Query Manager Form) Command
  • CRTQMQRY (Create Query Manager Query) Command
  • DLTQMFORM (Delete Query Manager Form) Command
  • DLTQMQRY (Delete Query Manager Query) Command
  • RTVQMFORM (Retrieve Query Manager Form) Command
  • RTVQMQRY (Retrieve Query Manager Query) Command
  • STRQMPRC (Start Query Manager Procedure) Command
  • STRQMQRY (Start Query Manager Query) Command
  • WRKQMFORM (Work with Query Manager Form) Command
  • WRKQMQRY (Work with Query Manager Query) Command
  • Chapter 5. Procedures
  • Creating Procedures
  • Example 1
  • Example 2
  • Steps for Creating a Procedure
  • User Interaction
  • Procedure Interaction
  • Procedure Objects
  • Error Handling
  • Error Categories
  • Chapter 6. Report Forms
  • How Applications Can Use the FORM
  • Creating Forms
  • Creating a Default Form
  • Formatting Terminology
  • DBCS Data
  • COLUMN Fields
  • Data Type
  • Column Heading
  • Usage
  • Indent
  • Width
  • Datatype
  • Edit
  • Seq
  • Run-Time Defaults
  • Column Heading
  • Edit
  • Width
  • PAGE Fields
  • Blank Lines Before Heading/Footing
  • Blank Lines After Heading/Footing
  • Heading Text Lines
  • Line
  • Align
  • Page Heading Text
  • Footing Text Lines
  • Line
  • Align
  • Page Footing Text
  • FINAL TEXT Fields
  • New Page for Final Text
  • Put Final Summary at Line
  • Blank Lines before Text
  • Line
  • Align
  • Final Text Lines
  • BREAK Fields
  • New Page for Break/New Page for Footing
  • Repeat Column Heading
  • Blank Lines before Heading/Footing
  • Blank Lines after Heading/Footing
  • Put Break Summary at Line
  • Break Heading Text Lines
  • Line
  • Align
  • Break Heading Text
  • Break Footing Text Lines
  • Line
  • Align
  • Break Footing Text
  • OPTIONS Fields
  • Detail Line Spacing
  • Outlining for Break Columns
  • Default Break Text
  • Column Wrapped Lines Kept on a Page
  • Column Heading Separators
  • Break Summary Separators
  • Final Summary Separators
  • Chapter 7. Callable Interface
  • Callable Interface Description
  • Interface Communications Area (DSQCOMM)
  • Return Codes
  • Return Variables
  • Command Message Variables
  • Query Message Variables
  • Query Management Command Syntax Extension
  • Extended Variable Support
  • Creating Variables
  • Referencing Variables
  • Variable Names
  • Variable Values
  • Character variables
  • Integer variables
  • Query Management Defined Variables
  • Commitment Control
  • Accessing the Callable Interface with HLL Programs
  • C Language Interface
  • Example DSQCOMMC
  • C Variable Support
  • DSQCIC Function Syntax
  • DSQCICE Function Syntax
  • Interface Communications Area (DSQCOMM)
  • Return Codes
  • Sample C Language Query CI Program
  • COBOL Language Interface
  • DSQCIB Function Syntax
  • DSQCIB Extended Function Syntax
  • Interface Communications Area (DSQCOMM)
  • Return Codes
  • COBOL Query CI Program Example
  • COBOL Query CI Program Example 2
  • RPG Language Interface
  • DSQCIR Function Syntax
  • DSQCIR Extended Function Syntax
  • Interface Communications Area (DSQCOMMR)
  • Return Codes
  • RPG Language Query CI Program: Example 1
  • RPG Language Query CI Program: Example 2
  • Using Subprograms to Access the CI
  • START Subprogram
  • SETC Subprogram
  • SETA Subprogram
  • SETN Subprogram
  • RUNQ Subprogram
  • RUNP Subprogram
  • EXIT Subprogram
  • Chapter 8. Exported and Imported Objects
  • General Object Formats
  • Comments in Externalized Query Management Objects
  • External Formats
  • Panel Format
  • Encoded Format
  • Size of the Encoded Format
  • Records that Make Up the Base Encoded Format
  • Header ("H") Record
  • Value ("V") Records
  • Table Description ("T") Records
  • Table Row ("R") Records
  • End-of-Object ("E") Record
  • Application Data ("*") Record
  • EXPORT and IMPORT File Considerations
  • Ambiguous Date and Time Literals
  • Variable-Length Fields
  • Display Format
  • Encoded Format
  • Importing a Form Object
  • Columns Table Details
  • Exporting a Form Object
  • Record Format Rules
  • Specific Query Object Formats
  • Externalized FORM Format
  • Externalized PROC and QUERY Formats
  • IMPORT Query Considerations for Sort Sequence
  • Error Handling and Warning Conditions
  • Failing Conditions
  • EXPORT QUERY Considerations for Sort Sequence
  • Externalized Query Description
  • Chapter 9. Distributed Relational Database Architecture (DRDA)
  • Remote Unit of Work (RUW)
  • Distributed Unit of Work (DUW)
  • Connection Management Statements
  • Connection Management
  • Conversation Types
  • Read-only Connections
  • Status
  • Connection Management Method Considerations
  • Using the DSQRDBCNNMTH Keyword with START
  • Using the DSQSDBNM Keyword with START
  • DRDA and Activation Groups
  • Considerations
  • Default Activation Group
  • Non-default Activation Group
  • Default and Non-Default Activation Groups
  • Two Non-Default Activation Groups
  • Command Considerations with DRDA
  • SAVE DATA AS
  • Other Query Management Commands
  • Commitment Control
  • ILE C/400 Considerations
  • Understanding Commitment Control for Non-Default Activation Groups
  • Understanding Commitment Control for Default Activation Groups
  • Remote Processing and Long Column Names
  • Chapter 10. Coded Character Set Identifiers (CCSIDs)
  • Import CCSID Processing
  • Export CCSID Processing
  • Print CCSID Processing
  • Sort Sequence CCSID Processing
  • Other Considerations
  • Chapter 11. DB2 for AS/400 Query Management Considerations
  • Override Considerations
  • Tables and Views
  • Tables Referred to on the ERASE TABLE Command
  • Tables and Views Referred to on the SAVE DATA AS Command
  • IMPORT and EXPORT Source Files
  • Query Procedures
  • Miscellaneous Tips and Techniques
  • Printing a Query Management Object
  • Changing STRQMQRY Defaults for QRYDFN Use
  • Displaying Information about Using QRYDFN Objects
  • Defining Queries with Global Variables Using Query/400
  • Using Query/400 with Query Management/400
  • Using Query/400 to Create a QMFORM for an Existing QMQRY
  • Displaying Data from a Single Oversized Record
  • Using Query Management or CL Commands in PDM Options
  • Creating a CL Program for Permanent Conversion of a QRYDFN Object
  • Querying for Field Values
  • Passing Variable Values to a Query
  • Defining a Column with No Column Heading
  • Using Query Management to Format an ISQL-Developed Query
  • Using ISQL Select Report Processing with Referential Constraints
  • Using Text Insertion Variables To Stack Captions on Final Summaries
  • Using Text in Combination with Tabular Layout
  • Converting a Multiple-Level Summary-Only QRYDFN
  • Sorting and Subsetting Break-Level Summary Groups
  • Adding SAA Function
  • SAA Functions That Can Be Added
  • Run-Time Environment
  • Limits to Query Management Processing
  • The Query Management Command
  • SQL Query
  • Externalized Query
  • Externalized Form
  • Instances
  • Global Variables
  • Procedures
  • Release-to-Release Considerations
  • Chapter 12. Using Query/400 Definition Information
  • QRYDFN Conversion
  • Applying DB2/400 Query Management to QRYDFN Objects
  • QRYDFN Conversion Considerations
  • Report Differences
  • Analyzing a QRYDFN
  • Inspecting the Output
  • Applying QRYDFN Option Guidelines
  • Query/400 and DB2 for AS/400 Query Management Differences
  • Creating DB2/400 Query Management Objects from QRYDFN Objects
  • Using the STRQMQRY Command Instead of the RUNQRY Command
  • Conversion Details
  • Chapter 13. Control Language Interface
  • Creating QMQRY and QMFORM Objects
  • Sample CL Program for Numeric Variables
  • Creating QMQRY and QMFORM Objects for Character Variables
  • Sample CL Program for Character Variables
  • Appendix A. DBCS Data
  • What Is DBCS Data?
  • Displayed and Printed DBCS Data
  • Data Types Used with DBCS Data
  • Using DBCS Data in DB2/400 Query Management
  • Using DBCS Data in Input Fields
  • Using DBCS Data in Queries
  • Using DBCS in the FORM
  • How Data Truncation is Handled
  • Saving DBCS Data
  • Using DBCS Global Variables in DB2/400 Query Management Commands
  • CL Commands
  • Exporting DBCS Data
  • Importing DBCS Data
  • Printing DBCS Reports
  • Appendix B. DB2/400 Query Management Interface Example
  • Producing a Report
  • Sample Programs
  • Sample RPG Program
  • Sample COBOL Program
  • Query and Form Source
  • Query and Form Printed Output
  • Appendix C. Use of Quotation Marks and Apostrophes When Setting Global Variables
  • Query Global Variable Pool
  • CL Command
  • Message prompt
  • High-Level Language Programming
  • Using a Query Procedure
  • Methods for Simplification
  • Appendix D. Sort Sequence Examples
  • Sort Example
  • Record Selection Example
  • Report Breaks Example
  • Grouping Example
  • Break Summary Use
  • Chapter 14. Bibliography
  • For the AS/400 System
  • For the SAA Solution
  • For Implementation on the System/370 Computer
  • For Implementation with the OS/2 Licensed Program
  • Index




    Top of Page | Previous Page | Next Page | Table of Contents | Index ]

    Tuesday, February 10, 2015

    Problem When Upgrading CRM 4 to CRM 2011 - Could not load file or assembly 'Microsoft.Crm.Reporting.DataExtension.Common.Fetch

    I got the error dialog saying:

    ---------------------------
    Microsoft Dynamics CRM Setup
    ---------------------------
    Action Microsoft.Crm.Tools.Admin.ProvisionOrganizationLanguagesAction failed.
    Could not load file or assembly 'Microsoft.Crm.Reporting.DataExtension.Common.Fetch, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.


    C# Code Parsers, mainly for SQL Parsing

    .NET SQL Parser and Formatter Tool and SSMS Plugin : https://github.com/benlaan/sqlformat

    Looks complicated but stable. uses Laan? algorithm.


    SQL Parser on CodeProject : http://www.codeproject.com/Articles/32524/SQL-Parser
    Looks interesting, has good explanation of the method used.

    Gold Parser : http://goldparser.org/about/why-use-gold.htm
    uses LALR algorithm, looks great and fast, simple to define languages.
    Developed for .NET in Visual Basic.
    Introduction in CodeProject : http://www.codeproject.com/Articles/10492/Introduction-to-GOLD-Parser
    BSN-GoldParser https://code.google.com/p/bsn-goldparser/ : a project that uses GOLD parser . It builds a Sample Calculator here
    There is a TSQL Parser based on the BSN project here
    the above is based on a project for T-SQL Parsing by  Arsène von Wyss. C.f., found here 

    ANTLR  : http://www.antlr.org/
    Uses LL Algorith. Looks like it is the most used library. NHibernate used it for HSQL Parsing, I guess it was similar to HSQL in Java Hibernate.
    This is developed by Terence Parr at the university of San Diego.

    Grammatica : http://grammatica.percederberg.net/index.html
    Uses LL Algorith, has Java and C# implemetation.

    Wednesday, January 28, 2015

    Convert HTML to DocX / OpenXML

    http://html2openxml.codeplex.com/wikipage?title=Serves%20a%20generated%20docx%20from%20the%20server&referringTitle=Documentation

    OpenXML SDK 2.5 from Microsoft : http://www.microsoft.com/en-us/download/details.aspx?id=30425

    Html to OpenXML http://html2openxml.codeplex.com/

    DOCX  Discussion on the Topic : https://docx.codeplex.com/discussions/254637

    Render HTML in Reportings Services 2008 : http://sqlblog.com/blogs/greg_low/archive/2008/12/19/rendering-html-in-reporting-services-text-boxes-in-sql-server-2008.aspx

    Adding Alternative Text using OpenXML SDK : http://stackoverflow.com/questions/18089921/add-html-string-to-openxml-docx-document

    3M SIP2 Resources and Implemetations - Standard Interchange Protocol

    Definition in PDF : http://bibliotecaeupo.es/utils/SIP2/sip2_docs/sip2_developers_guide.pdf

    PHP Implemetation : https://code.google.com/p/php-sip2/source/browse/trunk/sip2.class.php

    Simple 3M SIP2 Standard Interchange Protocol implementation in perl : https://github.com/dpavlin/Biblio-SIP2

    SIP2 Client in C# : https://github.com/NiceAndNerdy/SIP2.NET

    Definitions and Examples from OCLC http://www.oclc.org/support/help/olib/900/Content/System/Supported%20SIP2%20Messages.htm#63_(Patron_Information)

    MS Asynchronous Server Socket Example :
    https://msdn.microsoft.com/en-us/library/fx6588te(v=vs.110).aspx
    and Explanation of the sampe : https://msdn.microsoft.com/en-us/library/5w7b7x5f(v=vs.110).aspx

    A TcpServer like the One in Delphi on CodeProject , looks great: http://www.codeproject.com/Articles/488668/Csharp-TCP-Server
    The Server App freezes on Invoke so replace it with BeginInvoke methd.

    Another TCP Server Example : http://sonyarouje.com/2011/11/25/multi-client-asynchronous-tcp-server/

    Javascript inside C#

    https://jint.codeplex.com/ - Jint - Javascript Interpreter for .NET

    Tuesday, January 27, 2015

    Looking for Route message paramters : found List of InputParameters and OutputParameters for CRM 2011

    following the artice by CRM2011 Plugin InputParameter and OutputParameter Helper by Michel Palmer.
    The lists does not show output parameters for Route Message.
    This did not help much so I added code to my plugin to list the parameters for Route Message.

    Monday, January 26, 2015

    Convert DocX or Doc to PDF

    Using FixIT : Link to an interesting blog entry by Anon(?)
    http://wpf4developers.blogspot.de/2014/05/c-convert-docx-to-pdf-document.html


    using Word : an Asnwer by Demir. Because of licensing, if you do it in real time, Microsoft demands licensing office for all users in the network !!!!
    http://stackoverflow.com/questions/19560170/how-to-convert-docx-to-pdf-in-c-sharp
    This should be done in a background process.


    Another answer using Word Automation :
    http://stackoverflow.com/questions/5431580/convert-html-to-docx-in-c-sharp