Information icon IBM Information Server, Version 8.1
Feedback

End Statement

Indicates the end of a program, a subroutine, or a block of statements.

Syntax

End 
End Case

Remarks

Use an End statement in the middle of a program to end a section of an If statement or other conditional statements.

Use End Case to end a set of Case statements.

Examples

This example illustrates the use of an End statement with various forms of If...Then construction in a routine:

Function MyTransform(Arg1, Arg2, Arg3)
* Then and Else clauses occupying a single line each:
   If Arg1 Matches "A..."
      Then Reply = 1
      Else Reply = 2
* Multi-line clauses: 
   If Len(arg1) > 10 Then
   Reply += 1
   Reply = Arg2 * Reply
   End Else
      Reply += 2
      Reply = (Arg2 - 1) * Reply
   End
* Another style of multiline clauses:
   If Len(Arg1) > 20 
   Then
      Reply += 2
      Reply = Arg3 * Reply
   End 
   Else
      Reply += 4
      Reply = (Arg3 - 1) * Reply
   End
Return(Reply)

This example uses an End Case statement with a Case statement:

Function MyTransform(Arg1)
   Begin Case
   Case Arg1 = 1
      Reply = "A"
   Case Arg1 = 2
      Reply = "B"
   Case Arg1 > 2 And Arg1 < 11
      Reply = "C"
   Case @True      ;* all other values
      Call DSTransformError("Bad arg":Arg1, "MyTransform"
      Reply = ""
   End Case
Return(Reply)

PDF This topic is also in the IBM WebSphere DataStage Server Job Developer Guide.

Update icon Last updated: 2008-09-30