Page 1 of 1

How to Learn Routines?

Posted: Wed Jun 29, 2011 4:51 am
by thanush9sep
Recently moved to a new Organization and learning lot of things....

I was always eager to learn Routines, however was running away from it, thinking it would not fit into my brain...

This post is about my recent experience in this organization. I have been told to write small description of already existing Routines, and I have no knowledge about it..

I came across a Routine called rtSetParamsFromFile. Below are the few line that I encountered and seriously I have no clue about these things

Code: Select all

$INCLUDE DSINCLUDE DSD_STAGE.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$INCLUDE DSINCLUDE DSD.H
$INCLUDE DSINCLUDE DSD_RTSTATUS.H

      Equ Me To 'SetParamsFromFile'

*  Diags added briefly 19/01-2011
      TODAY = OCONV(DATE(),"D-YMD[4,2,2]")
      TIMET = OCONV(TIME(),"MTS")
      TIMESTAMP = TODAY:" ":TIMET
      TXT = "After job started at:  ":TIMESTAMP
      Call DSLogInfo(TXT, Me)
* End of diags

      If Not(DSJobName) Then Return(0)

! Do nothing if the Job has no parameters

      JobName = Field(STAGECOM.NAME,'.',1,2)
      ParamList = STAGECOM.JOB.CONFIG<CONTAINER.PARAM.NAMES>
It would be better if somebody could give their opinion about writing Routines... and clarify the below

a) what is the use of DSD_STAGE.H
b) what is STAGECOM.NAME,
STAGECOM.JOB.CONFIG<CONTAINER.PARAM.NAMES>

My concern is that I have no clue where to start learning Routines, However i know what are the usage of DSLogInfo etc etc

Posted: Wed Jun 29, 2011 5:25 pm
by ray.wurlod
The DSXchange Learning Center has a DVD called "Programming with DataStage BASIC" which is mainly about routines (and expressions) written in that language.

DSD_STAGE.H is a header file containing constant and variable definitions such as STAGECOM.NAME, CONTAINER.PARAM.NAMES and STAGECOM.JOB.CONFIG.

The angle brackets are "dynamic array notation"; an alternate syntax to the Field() function for extracting elements from dynamic arrays.