Wednesday, 28 October 2015

adding suffix yyyymmdd (filename_20151028.csv) in format through shell script.

Adding date suffix in a file by using shell script mentioned  syntax...
 
       current_time=`date '+%Y%m%d'`  // get date in yyyymmdd format
        index=`echo "${#i}-4" | bc`        // here i is variable contains file name
        fileName=${i:0:$index}             // adding defined index
        extension=${i:$index}     
        echo $extension                             // printing extension

Thursday, 22 October 2015

Best tutorial site for Java Begineers

Best tutorial site for Java Begineers:-

https://www.udemy.com/java-tutorial/

Tuesday, 20 October 2015

TDI Default Server is not coming up on port 1099 & 1098


As I understood, I have been kill the running service on port 1099 & 1098 but still TDI default server is not coming up.


here is the error.
2015-10-20 17:13:12,777 INFO [server] - CTGDIS232I Server is running in standard mode.

2015-10-20 17:13:13,121 INFO [server] - CTGDIS236I The stash file has been successfully read.

2015-10-20 17:13:13,121 INFO [server] - CTGDIS237I The key password is not present in the stash file. The keystore password will be used.

2015-10-20 17:13:13,141 INFO [server] - CTGDIS238I Server security has been successfully initialized.

2015-10-20 17:13:13,445 INFO [com.ibm.di.api] - CTGDKD445I Custom method invocation is set to false.

2015-10-20 17:13:13,554 ERROR [com.ibm.di.api] - CTGDKD019E Could not create RMI Registry:: java.rmi.server.ExportException: Listen failed on port: 1099; nested exception is:

java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind

2015-10-20 17:13:13,567 ERROR [server] - CTGDIS206W An error has occurred on Remote Server API initalization: com.ibm.di.api.DIException: CTGDKD019E Could not create RMI Registry:: Listen failed on port: 1099; nested exception is:

java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind

com.ibm.di.api.DIException: CTGDKD019E Could not create RMI Registry:: Listen failed on port: 1099; nested exception is:

java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind

at com.ibm.di.api.APIEngine.logErrorAndThrowException(APIEngine.java:1223)

at com.ibm.di.api.APIEngine.initRMIRegistry(APIEngine.java:1295)

at com.ibm.di.api.APIEngine.initializeRemote(APIEngine.java:699)

at com.ibm.di.server.RS.initializeAPIEngine(RS.java:701)

at com.ibm.di.server.RS.runMaster(RS.java:2299)

at com.ibm.di.server.RS.run(RS.java:2077)

at com.ibm.di.server.RS.main(RS.java:637)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

at java.lang.reflect.Method.invoke(Method.java:600)

at com.ibm.di.loader.ServerLauncher.startServer(ServerLauncher.java:173)

at com.ibm.di.loader.ServerLauncher.main(ServerLauncher.java:79)

2015-10-20 17:13:13,977 INFO [server] - CTGDIS232I Server is running in standard mode.


quick suggestion will highly appreciated...!!


Solution found :- First of all check the host file of the machine on which TDI server is installed because manually I had entered ip address in host file so that's why local system was unable to reach the actual assigned ip address.
Secondly port was conflicting due to running multiple running java process after ending process default TDI Server come up , now its working fine , thanks

"Resource is out of sync with file system:/TDIServers/Default.tdiserver" Error is fixed

Here is small fix for TDI resource out of sync Error

"Resource is out of sync with file system:/TDIServers/Default.tdiserver"

Steps :- Launch TDI --Select window --Select Preference --Gernel--workspace--Check Refresh automatically--Apply--ok

Tx:
Arvind

Wednesday, 14 October 2015

Rename files though TDI hooks

Renaming files from TDI by using this script in hooks


var Name1 =system.getExternalProperty("File1"); 
var Name2 = system.getExternalProperty("File2");
try {
      var ReadFile = new java.io.File(Name1);
      //read last created file
      if(ReadFile.length()>0) {
       //task.logmsg ("%%%%%%%Epilog: newfile: "+ReadFile);
        system.renameFile(Name1, Name2);
      }
}
catch (e) {
      task.logmsg(e.toString());
}

TDI Coding and Concept URL

Return date in csv file

Returning date in csv file during data flow from ldap to csv and map the date attribute in output mapping flow in connector

now = new java.util.Date();  //declare variable
ret.value = system.formatDate(now, "ddMMyyyy"); // return date