Code snippets

This page contains code snippets that i placed here so that i don't forget them. The snippets are stored in a custom plugin that i created for Typo3.

  • Datastagebasic
    • EasterDay
      Calculate first easter day for the given year using algorithm of Oudin
    • GetXMLProperty
      Get property value from XML part. I use it to get data from Datastage XML exports
    • IsFloat
      Deze functie had ik nodig om te bepalen of een getal uit een tekstbestand een float is of niet. De standaard datastage controles voldeden niet omdat Datastage probeert te bedenken wat het zou moeten zijn. --1 zet Datastage bijvoorbeeld om naar -1. Deze functie is heel strict.
    • IsInt
      Deze functie had ik nodig om te bepalen of een getal uit een tekstbestand een integer is of niet. De controle met X = Iconv("987654", "MD0") en dan via ConvStatus = Status() controleren of de conversie gelukt was, werkte niet afdoende. Deze conversie gaat namelijk ook goed bij floating point getallen. Deze functie is heel strict.
    • StrReplace
      Hoofdletter ongevoelige versie van Ereplace
  • Informatica
    • Field function
      This function returns the n-th field from a given string divided by a delimiter
    • Purge deleted objects from Powercenter repository
      If you delete an object in Powercenter the object isn't really deleted. It's only marked as deleted in the repository. With this command you can purge the deleted object to reduce the size of the repository.
    • Purge old versions from a versioned repository
      If you have a versioned Powercenter repository the size keeps growing with every version of an object. With this command you can purge old versions. The -n 1 keeps only the current version. Increase the number to keep more versions.
  • Java
  • Oracle
    • Change userschema
      Change the database schema after logging in.
    • Create database link
      Create an Oracle database link to use tables from a different database than you're working in.
    • Create Oracle synonym
      Create a synonym to a table in another schema. SCHEMA_1 is the schema where the original schema exists. SCHEMA_2 is the schema where you want to use the table. The name of the user is the same as the schema name (SCHEMA_2).
    • Find Oracle objects in all schemas
      Find Oracle objects in all schemas to find out where an object exists in case of ora-00955 error.
    • Querying with different aggregate levels
      Use oracle Analytic functions to report data from different aggregate levels
    • Rawtohex
      See strange data in your Oracle tables? The standard rawtohex function lets you see whats in there.
    • Update table based on rownum with where clause
      We used this query to assign batch id's to records based on rownum. A normal update wouldn't work because we needed a where clause.
  • Visual Basic for Applications