Metaprogramming in Abinitio 1. How to create output DML dynamically based in INPUT DML 2. How to create intermediate transform( XFR) dynamically based on INPUT DML Please See my you tube video for explanation : PART 1 PART 2 For Example, let us say, we have an Input DML as below-: cat input.dml record string(",") name; decimal(",") age; decimal(",") salary; string(",") aadharid; date("yyyy-mm-dd")(",") joiningdate; string(",") mobileno=NULL; string(",") dlno=NULL; string(",") passportnumber=NULL; end; (1.1) prepare a new DML based on input DML i.e. add fields, remove fields, modify type Graph based parameters: ===================================================================== input_dml=$DIR/input.dml [interpretation = constant] input_dml_info =$[read_type(input_dml)] [interpretation = pdl] /* Define functions in AB_DML_DEFS */ AB_DML_DEFS= $[ out:: dynamic_dml_gen(input_dml_info)= beg...
Popular posts from this blog
Abinitio Interview Question # 1 - Write Multiple Files in Abinitio
Question : I get records of various region in huge volume , we want to write the records in region specific files. How to achieve that? View the explanation in the below video: Answer: -WMF WMF: filename::get_filename(in)= begin let string("") l_filename=string_substring(in.data.region); filename::string_concat($AI_SERIAL,"/",l_filename.dat); end; out::reformat(in)= begin out::in.data; end; OUTPUT DML-: DML record string(int) filename; string(integer(4)) file_contents; end; RMF: filename::get_filename(in)= begin filename::string_concat($AI_SERIAL,"/",in.filename); end; out::reformat(read,filename,in)= begin out.file_contents::read; out.filename::filename; end; Please view my youtube channel DataPundit
Abinitio Interview Question 43
Abinitio Interview Question 43 cust_id, card_type 111, platinum 111, gold 111, silver 222, ruby 222, gold 222, platinum 222, diamond 333, iron 333, copper 333, gold Find out the customer who has all 3 - diamond,platinum and gold called premium customer. constant string1 =diamond constant string2 =platinum constant string3 =gold //let string(20)[3] my_vec=[vector 'diamond','platinum','gold']; type temporary_type= begin decimal("") cnt; string(",") ctypes; end; out::initialize(in)= begin temp.cnt::0; end; out::rollup(temp,in)= begin temp.cnt::if(in.card_type member [vector 'diamond','platinum','gold']) temp.cnt+1 else temp.cnt; temp.ctypes::string_concat(temp.ctypes,in.card_type); end; out::final...
Comments
Post a Comment