Simple, fast way to create files in Siebel

Siebel provides tens of ways to accomplish one task. Creating files is a good example to explore the myriad ways to create a text file and populate it with content.

I will filter out all the other ways, and tell you the fastest, most simple way of creating a file. Use the CLIB functions. The C libraries are called by the Siebel OOB business services, workflows too, and when used properly provide the fastest way to achieve a given task.

 

Create File in Siebel – the fastest way

>> Although I have used this method of creating files using CLIB functions, it is not recommended (or turned on by default) by Oracle post Siebel version 8.1.1.11. See comments below. <<

Without much ado, here’s the script to create the file.

What the script does is self-evident (you can use the crmcog utility to debug scripts faster) .

  1. Accept the file name as sFile
  2. Accept the text content that needs to in a file – sContent
  3. Create the file using the CLIB function fputs
  4. Close the file, finish the job, and let you enjoy your life

If you are stuck in a Siebel application that uses a LOT of file transfers, you may even want to include this as an application function.

 

Compare to other ways of creating files in Siebel

There were always two camps that use Siebel scripting. One that advocates the use of CLIB functions, and the other is a fan of using Siebel provided functions.

Siebel functions and services abstract the CLIB functions, and have their advantages. They provide easier, better error handled ways of accomplishing a given task.

I will take one such example for creating files.

EAI File Transport is a business service that can do all the file handling for you.

The Send method in EAI File Transport service accepts the following arguments:

Siebel EAI File Transport Send method

It is fairly obvious that this service can do a lot more than what was demonstrated earlier in this post. You can:

  • Create new file, or append to file
  • Use a connection subsystem named parameter – this implies that the file name is separated from the code. You can configure this parameter value outside the core system (typically in the CFG file, or Enterprise Parameters)
  • Handle various code pages
  • Ask Siebel to use a transformation service to handle outgoing data

All these are invaluable, no doubt. But at the end of the day Siebel services sit on top of C library functions, and will have their overhead. This may be in milliseconds, but overhead nonetheless.

My typical rule of thumb is to use Siebel services in case of any medium or high complexity tasks. You are better prepared to scale the complexity as it happens, you do lesser coding, and error handling is better. However, for simpler tasks you are better off using CLIB functions. They are simpler, have lesser overhead, and are faster.

Leave a Reply

2 Comments on "Simple, fast way to create files in Siebel"

avatar
  Subscribe  
newest oldest most voted
Notify of
Alexander Hansal
Guest

Nice article and good to see that you are recommending business services over custom scripting. Please also be aware that ‘shell access functions’ such as Clib.fopen are no longer supported as of 8.1.1.11 and higher. More info here:

http://www.siebel-essentials.com/2013/11/siebel-scripting-important-changes.html

have a nice day

@lex

Prashanth K
Guest

Thank you.
This was a typical case of “I heard, but did not listen”.
I had performance numbers for Siebel business services vs. CLIB, but did not have them handy now. WIthout that and with the Oracle recommendation for not using CLIB, there is no case for CLIB. Edited the post.