Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SAS script importing data from textfile to PALO olap DB

Status
Not open for further replies.

karlomutschler

Programmer
Jun 5, 2001
75
DE
good day,

need to develop a SAS script to import data from a textfile
into PALO olap DB.

An example provided (using PHP) reads as follows:

<?php

define('HOST', '127.0.0.1');
define('PORT', '7777');
define('USER', 'admin');
define('PASS', 'admin');

$connection = palo_init(HOST, PORT, USER, PASS);
// print_r($connection);

$cube = 'Data';
$dbname = 'DB_01';
// $number = palo_ecount($connection, $dbname, 'Dimensionsname');

$fp = fopen('export.txt','r');

$recno = 1;

while (!feof($fp)){
$line = fgets($fp, 2048);
list ($dim1, $dim2, $dim3, $dim4, $dim5, $dim6, $value) = split (chr(9), $line);

PALO_SETDATA($value, FALSE, $connection, $dbname, $cube, $dim1, $dim2, $dim3, $dim4, $dim5, $dim6);

$recno = $recno+1;
echo $recno . "<br>";
}
fclose($fp);
palo_disconnect($connection);

?>

How would one go about and translate this into SAS-script?

Any assistance or help would be highly appreciated
Kindest regards
Karlo
 
Are you able to get to the destination DB through SS/Access? There's a process called Proc DBLOAD which might be of use to you. I've used it a few times (some time ago now I'm afraid) to load data into Oracle. It's worth a shot.
Also, you can use proc SQL like this:-
Code:
 proc sql; 
  insert into &dbase..&table.
  (bl_direct_path=NO,bulkload=yes,%bquote(&datstring)
      &DBLVARS)
  (select
      &DBLVARS
  from &source..&table)
  ; 
quit;
where &DBLVARS is a list of the variables to be loaded (separated by commas). BULKLOAD=YES prompts SAS to use the bulkloader provided by the database system to load the data and is supposed to be really efficient for loading large chunks of data. I used this for uploading very large chunks of data for a migration project a few years ago and it worked really well. As I said though, this was for Oracle, so I don't know how well this transfers to other DBs.

Chris
Business Analyst, Code Monkey, Data Wrangler.
SAS Guru.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top