Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Inside Module 8 Extracting Data Page n Using the Extract command2 n Coercion3 n $-functions4 n Extract from a table7.

Similar presentations


Presentation on theme: "1 Inside Module 8 Extracting Data Page n Using the Extract command2 n Coercion3 n $-functions4 n Extract from a table7."— Presentation transcript:

1 1 Inside Module 8 Extracting Data Page n Using the Extract command2 n Coercion3 n $-functions4 n Extract from a table7

2 2 Extract basics n Extract command “extracts” the data from the input source n Fields are “placed” in the output file in order of the extract commands n Extract a range of fields n Extracting constants

3 3 Coercion and Numeric Expressions n Extract also coerces data from the source to the target n Changes from one data type to another Define display-field,1,8,display Extract display-field = double-field n Simple Arithmetic functions Extract total = cost * qty Extract budget99 = actual98 + 1000 Extract profit = sales-amt – cost Extract average = total / qty Extract day = ccyymmdd-date mod 100

4 4 Date $- functions n $date –specify constant or relative date value in various formats n $today –current system date or calculate a date relative to the system date n $stddate –converts a date in any format to CCYYMMDD n $days –converts the date into a Julian format

5 5 String $- functions n $upper –converts all alphabetic characters to uppercase n $lower –converts all alphabetic characters to lowercase n $trim –removes leading and trailing spaces n $ltrim –removes leading spaces n $rtrim –removes trailing spaces

6 6 Numeric$- functions n $abs –Returns absolute value of a number n $truncate –Returns a number to the left of the decimal place

7 7 Extract from a table n $lookup available in Extract but slightly different Must load the table with data Table mytable,key,file,sdfilename,data(tabledata) File must be self-describing Extract field = $lookup(mytable,key,tabledata)

8 8 Extract from a Table Sample >table newprices,prodno,file,bosslist,data(price,desc) >get part-master >if $lookup(newprices,prodno) >update >extract price = $lookup(newprices,prodno,price) >extract desc = $lookup(newprices,prodno,desc) >xeq

9 9 Summary n Extract command n Extract with coercion n Numeric Expressions n Extract with $-functions n Date functions n String functions n Numeric functions n Extract from a table


Download ppt "1 Inside Module 8 Extracting Data Page n Using the Extract command2 n Coercion3 n $-functions4 n Extract from a table7."

Similar presentations


Ads by Google