kevind0718 has asked for the wisdom of the Perl Monks concerning the following question:
ISIN: **US4663671091** CUSIP: **466367109** BBCode:**JBX UN** SEDOL: **2344922** Ticker: **JBX** SecType: **Equity** SecDesc: **JACK IN THE BOX INC** SecCurr: **USD** US4663671091 ISIN 466367109 CUSIP 05 30 CSV String: US4663671091,ISIN,466367109,CUSIP,,,05,30,,,,"JACK IN THE +BOX INC",,,USD,,, End-Of-Record
while($db->FetchRow()){ undef %rowData; %rowData = $db->DataHash(); print " ISIN: **". $rowData{ "ISIN"} . "**\n" ; $ISIN = $rowData{ "ISIN"} ; print "CUSIP: **". $rowData{ "CUSIP"} . "**\n" ; $CUSIP = $rowData{ "CUSIP"} ; print "BBCode:**". $rowData{ "Bloomberg_Code"} . "**\n" ; $BBCode = $rowData{ "Bloomberg_Code"} ; print "SEDOL: **". $rowData{ "Sedol" } . "**\n" ; $SEDOL = $rowData{ "Sedol" }; print "Ticker: **". $rowData{ "Ticker" } . "**\n" ; $Ticker = $rowData{ "Ticker" } ; print "SecType: **" . $rowData{ "Security_Type" } . "**\n" ; $SecurityType = $rowData{ "Security_Type" } ; print "SecDesc: **" . $rowData{ "Security_Description" } . "** +\n" ; $SecurityDesc = $rowData{ "Security_Description" } ; print "SecCurr: **" . $rowData{ "Security_Issue_Ccy" } . "**\n +" ; $SecIssueCCY = $rowData{ "Security_Issue_Ccy" } ; #** ** ** ** ** ** ** # Set the Primary Identifier if ( defined($ISIN) ) { $PIdentifier = $ISIN; $PIdentifierType = 'ISIN'; $ISIN = undef; } elsif ( defined($CUSIP)) { $PIdentifier = $CUSIP; $PIdentifierType = 'CUSIP'; $CUSIP = undef; } elsif (defined($SEDOL)) { $PIdentifier = $SEDOL; $PIdentifierType = 'SEDOL'; $SEDOL = undef; } elsif (defined($BBCode)) { $PIdentifier = $BBCode; $PIdentifierType = 'Bloomberg'; $BBCode = undef; } else { $PIdentifier = $Ticker; $PIdentifierType = 'Ticker'; $Ticker = undef; } #** ** ** ** ** ** ** # Set the secondary Identifier if ( defined($ISIN) ) { $PIdentifier2 = $ISIN; $PIdentifierType2 = 'ISIN'; $ISIN = undef; } elsif ( defined($CUSIP)) { $PIdentifier2 = $CUSIP; $PIdentifierType2 = 'CUSIP'; $CUSIP = undef; } elsif (defined($SEDOL)) { $PIdentifier2 = $SEDOL; $PIdentifierType2 = 'SEDOL'; $SEDOL = undef; } elsif (defined($BBCode)) { $PIdentifier2 = $BBCode; $PIdentifierType2 = 'Bloomberg'; $BBCode = undef; } else { $PIdentifier2 = $Ticker; $PIdentifierType2 = 'Ticker'; $Ticker = undef; } print $PIdentifier . " " . $PIdentifierType , "\n"; print $PIdentifier2 . " " . $PIdentifierType2 , "\n"; #** ** ** ** ** ** ** # Set Class and Sub Class if ('CASH' eq uc($SecurityType) ) { $class = '07'; $subClass = '60'; } elsif ('BOND' eq uc($SecurityType) ) { $class = '01'; $subClass = '03'; } elsif ('EQUITY' eq uc($SecurityType) ) { $class = '05'; $subClass = '30'; } elsif ('EQUITYFUTURE' eq uc($SecurityType) ) { $class = '02'; $subClass = '30'; } elsif ('EQUITYOPTION' eq uc($SecurityType) ) { $class = '03'; $subClass = '30'; } elsif ('PREFEQUITY' eq uc($SecurityType) ) { $class = '05'; $subClass = '31'; } else { $class = '00'; $subClass = '00'; } print $class . " " . $subClass , "\n"; $status = $csv->combine( ($PIdentifier , $PIdentifierType , $PId +entifier2 , $PIdentifierType2 , "", "", $class , $subClass ,"", "","", $SecurityDesc , + "", "", $SecIssueCCY , "", "", "" ) ) ; print "CSV String: " . $csv->string(); print "\nEnd-Of-Record \n\n" ; # new line } # ** ** **
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Text::CSV_XS issue
by WoodyWeaver (Monk) on Jan 09, 2008 at 21:07 UTC | |
|
Re: Text::CSV_XS issue
by Anonymous Monk on Jan 09, 2008 at 21:00 UTC | |
by kevind0718 (Scribe) on Jan 09, 2008 at 21:21 UTC | |
by Tux (Canon) on Jan 10, 2008 at 08:29 UTC | |
|
Re: Text::CSV_XS issue
by CountZero (Bishop) on Jan 10, 2008 at 06:29 UTC | |
by Anonymous Monk on Jan 10, 2008 at 19:31 UTC | |
|
Re: Text::CSV_XS issue
by Tux (Canon) on Jan 09, 2008 at 20:54 UTC | |
by kevind0718 (Scribe) on Jan 09, 2008 at 21:01 UTC | |
by Tux (Canon) on Jan 09, 2008 at 21:17 UTC |