data transformation
Download
Skip this Video
Download Presentation
Data Transformation

Loading in 2 Seconds...

play fullscreen
1 / 6

Data Transformation - PowerPoint PPT Presentation


  • 98 Views
  • Uploaded on

Data Transformation. Parsing: Splitting fields into atomic attributes. =SUBSTR ( string, position<, length> ). Use this when you have a known position for characters. String: character expression Position: start position (starts with 1)

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Data Transformation' - nicki


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
data transformation

Data Transformation

Parsing:

Splitting fields into atomic attributes.

substr string position length
=SUBSTR(string, position<, length>)

Use this when you have a known position for characters.

  • String: character expression
  • Position: start position (starts with 1)
  • Length: number of characters to take (missing takes all to the end)

VAR= ‘ABCDEFG’

NEWVAR= SUBSTR(VAR,2,2)

NEWVAR2= SUBSTR(VAR,4)

NEWVAR= ‘BC’

NEWVAR2= ‘DEFG’

substr variable position length new characters
SUBSTR(variable, position<,length>) = new-characters

Replaces character value contents. Use this when you know where the replacement starts.

a=\'KIDNAP\';

substr(a,1,3)=\'CAT\';

a: CATNAP

substr(a,4)=\'TY\' ;

a: KIDTY

index source excerpt
INDEX(source, excerpt)
  • Searches a character expression for a string of characters. Returns the location (number) where the string begins.

a=\'ABC.DEF (X=Y)\';

b=\'X=Y\';

x=index(a,b);

x: 10

x= index(a,’DEF’);

x: 5

alternative index functions
Alternative INDEX functions
  • INDEXC searches for a single character
  • INDEXW searches for a word:

Syntax

INDEXW(source, excerpt<,delimiter>)

length
Length

Returns the length of a character variable

  • The LENGTH and LENGTHN functions return the same value for non-blank character strings. LENGTH returns a value of 1 for blank character strings, whereas LENGTHN returns a value of 0.
  • The LENGTH function returns the length of a character string, excluding trailing blanks, whereas the LENGTHC function returns the length of a character string, including trailing blanks. LENGTH always returns a value that is less than or equal to the value returned by LENGTHC.
ad