<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Importing sql dump file into SAS Studio ODA in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906853#M40537</link>
    <description>&lt;P&gt;Most of that is gibberish to SAS (and to me).&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's look at one of the table creation blocks.&amp;nbsp; (Notice how I used the Insert Code button to paste the code into a text box.)&lt;/P&gt;
&lt;PRE&gt;--
-- Table structure for table `auscultation`
--

DROP TABLE IF EXISTS `auscultation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `auscultation` (
`FirstSound` enum('Y','N') NOT NULL,
`SecondSound` enum('Y','N') NOT NULL,
`mitralclickpresent` enum('Present','Absent') NOT NULL,
`Auscultation_id` int(1) NOT NULL,
`ChestSign_id` int(1) DEFAULT NULL,
`Murmur` enum('Y','N') NOT NULL,
UNIQUE KEY `Auscultation_id` (`Auscultation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
&lt;/PRE&gt;
&lt;P&gt;First thing I notice is those lines that start with two dashes.&amp;nbsp; I assume those a supposed to be comments of some type?&amp;nbsp; Perhaps dreaded end-of-line comments?&amp;nbsp; You will need to remove those or actually convert them into comments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next is that DROP TABLE IF syntax.&amp;nbsp; That is not valid SAS syntax.&amp;nbsp; I would just comment that out also.&amp;nbsp; SAS does not care if you try to recreate an existing table. It will happily blow away the existing one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you have some actual comments that perhaps have some special meaning to SQL server because of the ! right after the /* ?&amp;nbsp; They also have extra semicolon after the comment.&amp;nbsp; Neither the comment nor the extra semicolon will cause any trouble.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally we get to the actual CREATE TABLE statement.&lt;/P&gt;
&lt;P&gt;The first thing I notice is the use of backticks.&amp;nbsp; Not sure what flavor of SQL uses that.&amp;nbsp; If you set the DQUOTE=ANSI option on the PROC SQL statement and then convert those backticks into double quotes instead the code might work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you have that enum() thingy.&amp;nbsp; I would assume that they are trying to show the list of possible values?&amp;nbsp; You should comment that out and instead put in an actual variable TYPE there.&amp;nbsp; You would need to look at some of the actual DATA to know what they meant by that.&amp;nbsp; Did they mean that it should store 1 and 2 and display them as Y and N?&amp;nbsp; Did they mean it should store Y and N and just complain if you tried to store some other letter? Whether they want to store the display values or some code value will determine if those should be numeric variables or character variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have no idea what int(1) means as a type either.&amp;nbsp; But things are much easier in SAS.&amp;nbsp; You only have two types to worry about.&amp;nbsp; Numbers (which are 64-bit binary floating point values) and fixed length character strings.&amp;nbsp; I would assume you will want to define int(1) as num.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You also have those NOT NULL and DEFAULT NULL constraints.&amp;nbsp; Again those are generally useless in a SAS dataset.&amp;nbsp; NOT NULL SAS will accept.&amp;nbsp; DEFAULT NULL it does not.&amp;nbsp; And that is what SAS does anyway so comment it out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then there is that UNIQUE KEY ?&amp;nbsp; I assume that is somehow saying the following variable should be the key?&amp;nbsp; I would assume you would want to convert that into code to actually create an index.&amp;nbsp; You will need to make sure and remove the comma separator before it, which they inconveniently placed at the end of the line before instead of at the beginning of this line.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And that stuff after the end of the variable list does not really translate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So we end up with:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql dquote=ansi;
/*--*/
/*-- Table structure for table "auscultation"*/
/*--*/

/*DROP TABLE IF EXISTS "auscultation";*/
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "auscultation" (
"FirstSound" char(1) /*enum('Y','N')*/ NOT NULL,
"SecondSound" char(1) /*enum('Y','N')*/ NOT NULL,
"mitralclickpresent" char(7) /*enum('Present','Absent')*/ NOT NULL,
"Auscultation_id" num /*int(1)*/ NOT NULL,
"ChestSign_id" num /*int(1)*/ /*DEFAULT NULL*/,
"Murmur" char(1) /*enum('Y','N')*/ NOT NULL/*,*/
/*UNIQUE KEY "Auscultation_id" ("Auscultation_id")*/
) /*ENGINE=InnoDB DEFAULT CHARSET=latin1*/;
/*!40101 SET character_set_client = @saved_cs_client */;
create unique index  "Auscultation_id" on "auscultation"("Auscultation_id");
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which produces dataset like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1701980370715.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/90975i0410359C38E03D4C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_0-1701980370715.png" alt="Tom_0-1701980370715.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Dec 2023 20:19:44 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-12-07T20:19:44Z</dc:date>
    <item>
      <title>Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906410#M40495</link>
      <description>&lt;P&gt;Good morning all - I wonder if someone could help with what I thought would be a simple task.&lt;/P&gt;&lt;P&gt;I am trying to read into SAS [using SAS Studio 9.4 ODA on Windows 10] a small database that I saved as a dump file on my desktop and then uploaded this dump file onto the server [hardly 5-6 tables each with max 15 rows - total file size &amp;lt; 200 KB] so that I can then practice using PROC SQL queries to access specific data [learning exercise] from this database. I have tried various ways but in vain.&amp;nbsp; A couple of attempts are below:- [thanks in advance!]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attempt No. ONE.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;caslib mycaslib desc='MySQL Caslib'  
     dataSource=(srctype='mysql',           
                 host='localhost' 
                 username='root',           
                 password='[******]',          
                 database='cardiotech', 
                 schema='mySchema'); 
                  
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Log when I ran above code:&lt;/P&gt;&lt;DIV class=""&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class=""&gt;68&lt;/DIV&gt;&lt;DIV class=""&gt;69&lt;/DIV&gt;&lt;DIV class=""&gt;70&lt;/DIV&gt;&lt;DIV class=""&gt;71 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class=""&gt;81&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Attempt No. TWO:&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data _null_;  
  file "/home/myusername/sasuser.v94/SQL/bdump.sql"; 
  put 'select * from sashelp.class;'; 
run; 
options source2; 
proc sql; 
 
%include "/home/myusername/sasuser.v94/SQL/bdump.sql"; 
SELECT * FROM patients, chest_pain 
WHERE patient.patient_id = chest_pain.patient_id; 
 
RUN;&lt;/CODE&gt;&lt;/PRE&gt;Error message when I run No.2 code above:-&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;78 SELECT * FROM patients, chest_pain&lt;/DIV&gt;&lt;DIV class=""&gt;79 WHERE patient.patient_id = chest_pain.patient_id;&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: File WORK.PATIENTS.DATA does not exist.&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: File WORK.CHEST_PAIN.DATA does not exist.&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Apologies if I an missing something v empirical, but I hope this Q sparks some interest/enthusiasm, and that someone can find a few minutes to help out!&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Tysm again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 10:20:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906410#M40495</guid>
      <dc:creator>advanceddriver</dc:creator>
      <dc:date>2023-12-06T10:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906427#M40496</link>
      <description>&lt;P&gt;Your first attempt can't work because a caslib requires the SAS Viya version plus is for SAS CAS in-memory tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your 2nd attempt is much closer. The following code works&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path=%sysfunc(pathname(work));
data _null_;  
  file "&amp;amp;path/bdump.sql"; 
  put 'select * from sashelp.class;'; 
run; 
options source2; 
proc sql; 
   %include "&amp;amp;path/bdump.sql"; 
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A SQL Server dump file is for backup and import into SQL Server. You also couldn't use it for any other database like Oracle etc.&lt;/P&gt;
&lt;P&gt;If you want to use it for SAS SQL then you need to parse the dump file and amend the syntax so it's suitable for SAS Proc SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're on the right path but your data _null_ step needs to modify the dump file syntax and write SAS SQL syntax to the file which you use as %include. Something along the line of below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path=%sysfunc(pathname(work));
data _null_;  
/*  file print;*/
  file "&amp;amp;path/sas_syntax.sql"; 

  infile "/home/myusername/sasuser.v94/SQL/bdump.sql";
  input;
  /* here code that changes the string in _infile_ so it's good for SAS SQL */
  /* ..... */

  /* and now write the modified code to file */
  put _infile_; 
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 12:52:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906427#M40496</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-12-06T12:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906438#M40497</link>
      <description>&lt;P&gt;Can you share some example of the dump file ? (or create such example with anonimised data)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 13:37:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906438#M40497</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-06T13:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906714#M40512</link>
      <description>&lt;P&gt;Yes, please share som snippet from the dump file.&lt;/P&gt;
&lt;P&gt;If this is the type of dump file that contains SQL statements (CREATE TABLE and INSERT INTO), maybe your best shot is to open it in a text editor, and do find/replace on component to make compatible with SAS Proc SQL.&lt;/P&gt;
&lt;P&gt;Another option is to load into a SQL server database that your SAS installation can reach, using SAS/ACCESS (from SAS Compute) or Data Connectors (CAS). If your database is not too big you could use SQL Server Express ed.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 14:54:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906714#M40512</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2023-12-07T14:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906815#M40531</link>
      <description>&lt;P&gt;Hi there - thank you for your reply and request.&lt;/P&gt;&lt;P&gt;Please see below part of the sql code from the dump file [I used mysql to create this small database]:&lt;/P&gt;&lt;P&gt;[I did try to use the second snippet of code provided in the first reply; it ran and did not give any errors so I assume that it worked i.e. that it modified the mysql dump file to convert it into SAS compatible sql [??].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I failed in trying to subsequently import or use that file [I tried the IMPORT wizard, which gave an error that it did not recognize the DBMS type "mysql" OR "sql" - maybe I need to use a different DBMS type [??]]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I shall try and upload the code of my attempts as above in reply to the first reply to my Q.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- MySQL dump 10.13 Distrib 5.5.35, for Win64 (x86)&lt;BR /&gt;--&lt;BR /&gt;-- Host: localhost Database: cardiotech&lt;BR /&gt;-- ------------------------------------------------------&lt;BR /&gt;-- Server version 5.5.35&lt;/P&gt;&lt;P&gt;/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;&lt;BR /&gt;/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;&lt;BR /&gt;/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;&lt;BR /&gt;/*!40101 SET NAMES utf8 */;&lt;BR /&gt;/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;&lt;BR /&gt;/*!40103 SET TIME_ZONE='+00:00' */;&lt;BR /&gt;/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;&lt;BR /&gt;/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;&lt;BR /&gt;/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;&lt;BR /&gt;/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;&lt;/P&gt;&lt;P&gt;--&lt;BR /&gt;-- Table structure for table `ankle_swelling`&lt;BR /&gt;--&lt;/P&gt;&lt;P&gt;DROP TABLE IF EXISTS `ankle_swelling`;&lt;BR /&gt;/*!40101 SET @saved_cs_client = @@character_set_client */;&lt;BR /&gt;/*!40101 SET character_set_client = utf8 */;&lt;BR /&gt;CREATE TABLE `ankle_swelling` (&lt;BR /&gt;`type_id` int(11) DEFAULT NULL,&lt;BR /&gt;`severity` varchar(20) NOT NULL,&lt;BR /&gt;`swelling_time` int(11) NOT NULL,&lt;BR /&gt;`patient_id` int(11) DEFAULT NULL,&lt;BR /&gt;UNIQUE KEY `type_id` (`type_id`),&lt;BR /&gt;KEY `swellingFK` (`patient_id`),&lt;BR /&gt;CONSTRAINT `swellingFK` FOREIGN KEY (`patient_id`) REFERENCES `patient` (`patient_id`)&lt;BR /&gt;) ENGINE=InnoDB DEFAULT CHARSET=latin1;&lt;BR /&gt;/*!40101 SET character_set_client = @saved_cs_client */;&lt;/P&gt;&lt;P&gt;--&lt;BR /&gt;-- Dumping data for table `ankle_swelling`&lt;BR /&gt;--&lt;/P&gt;&lt;P&gt;LOCK TABLES `ankle_swelling` WRITE;&lt;BR /&gt;/*!40000 ALTER TABLE `ankle_swelling` DISABLE KEYS */;&lt;BR /&gt;/*!40000 ALTER TABLE `ankle_swelling` ENABLE KEYS */;&lt;BR /&gt;UNLOCK TABLES;&lt;/P&gt;&lt;P&gt;--&lt;BR /&gt;-- Table structure for table `auscultation`&lt;BR /&gt;--&lt;/P&gt;&lt;P&gt;DROP TABLE IF EXISTS `auscultation`;&lt;BR /&gt;/*!40101 SET @saved_cs_client = @@character_set_client */;&lt;BR /&gt;/*!40101 SET character_set_client = utf8 */;&lt;BR /&gt;CREATE TABLE `auscultation` (&lt;BR /&gt;`FirstSound` enum('Y','N') NOT NULL,&lt;BR /&gt;`SecondSound` enum('Y','N') NOT NULL,&lt;BR /&gt;`mitralclickpresent` enum('Present','Absent') NOT NULL,&lt;BR /&gt;`Auscultation_id` int(1) NOT NULL,&lt;BR /&gt;`ChestSign_id` int(1) DEFAULT NULL,&lt;BR /&gt;`Murmur` enum('Y','N') NOT NULL,&lt;BR /&gt;UNIQUE KEY `Auscultation_id` (`Auscultation_id`)&lt;BR /&gt;) ENGINE=InnoDB DEFAULT CHARSET=latin1;&lt;BR /&gt;/*!40101 SET character_set_client = @saved_cs_client */;&lt;/P&gt;&lt;P&gt;--&lt;BR /&gt;-- Dumping data for table `auscultation`&lt;BR /&gt;--&lt;/P&gt;&lt;P&gt;LOCK TABLES `auscultation` WRITE;&lt;BR /&gt;/*!40000 ALTER TABLE `auscultation` DISABLE KEYS */;&lt;BR /&gt;/*!40000 ALTER TABLE `auscultation` ENABLE KEYS */;&lt;BR /&gt;UNLOCK TABLES;&lt;/P&gt;&lt;P&gt;--&lt;BR /&gt;-- Table structure for table `chest_pain`&lt;BR /&gt;--&lt;/P&gt;&lt;P&gt;DROP TABLE IF EXISTS `chest_pain`;&lt;BR /&gt;/*!40101 SET @saved_cs_client = @@character_set_client */;&lt;BR /&gt;/*!40101 SET character_set_client = utf8 */;&lt;BR /&gt;CREATE TABLE `chest_pain` (&lt;BR /&gt;`pain_id` int(2) NOT NULL AUTO_INCREMENT,&lt;BR /&gt;`pain_type` varchar(30) NOT NULL DEFAULT 'unknown',&lt;BR /&gt;`pain_site` varchar(20) NOT NULL,&lt;BR /&gt;`pain_freq` enum('Once','Twice','Thrice','Several times') DEFAULT NULL,&lt;BR /&gt;`pain_severity` int(2) NOT NULL,&lt;BR /&gt;`pain_atrest_or_onexertion` enum('At Rest','On exertion') NOT NULL,&lt;BR /&gt;`pain_radiation` enum('none','left arm','right arm','jaw','back','neck') NOT NULL,&lt;BR /&gt;`patient_id` int(11) DEFAULT NULL,&lt;BR /&gt;`symptom_id` int(11) DEFAULT NULL,&lt;BR /&gt;`pain_per` enum('Minute','Hour','Day','Week') DEFAULT NULL,&lt;BR /&gt;PRIMARY KEY (`pain_id`),&lt;BR /&gt;UNIQUE KEY `pain_id` (`pain_id`),&lt;BR /&gt;KEY `painFK` (`patient_id`),&lt;BR /&gt;CONSTRAINT `painFK` FOREIGN KEY (`patient_id`) REFERENCES `patient` (`patient_id`)&lt;BR /&gt;) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1;&lt;BR /&gt;/*!40101 SET character_set_client = @saved_cs_client */;&lt;/P&gt;&lt;P&gt;--&lt;BR /&gt;-- Dumping data for table `chest_pain`&lt;BR /&gt;--&lt;/P&gt;&lt;P&gt;LOCK TABLES `chest_pain` WRITE;&lt;BR /&gt;/*!40000 ALTER TABLE `chest_pain` DISABLE KEYS */;&lt;BR /&gt;INSERT INTO `chest_pain` VALUES (3,'tight','retro-sternal','Twice',5,'On exertion','left arm',23,2,'Week'),(4,'tight','central','Twice',6,'At Rest','left arm',27,0,'Day'),(5,'Crushing','central','Thrice',8,'At Rest','left arm',28,0,'Week'),(6,'Crushing','central','Thrice',7,'On exertion','right arm',31,0,'Week'),(7,'Crushing','left precordial','Thrice',7,'On exertion','none',35,0,'Week'),(8,'Crushing','retro-sternal','Thrice',6,'On exertion','jaw',38,0,'Week'),(9,'Crushing','retro-sternal','Thrice',6,'On exertion','jaw',39,0,'Week'),(10,'Crushing','retro-sternal','Thrice',6,'At Rest','jaw',40,0,'Week'),(11,'Crushing','retro-sternal','Thrice',6,'At Rest','back',42,0,'Week'),(12,'Crushing','retro-sternal','Twice',6,'On exertion','back',43,0,'Week'),(13,'stabbing','retro-sternal','Twice',6,'On exertion','jaw',45,0,'Week');&lt;BR /&gt;/*!40000 ALTER TABLE `chest_pain` ENABLE KEYS */;&lt;BR /&gt;UNLOCK TABLES;&lt;/P&gt;&lt;P&gt;--&lt;BR /&gt;-- Table structure for table `chestsign`&lt;BR /&gt;--&lt;/P&gt;&lt;P&gt;DROP TABLE IF EXISTS `chestsign`;&lt;BR /&gt;/*!40101 SET @saved_cs_client = @@character_set_client */;&lt;BR /&gt;/*!40101 SET character_set_client = utf8 */;&lt;BR /&gt;CREATE TABLE `chestsign` (&lt;BR /&gt;`palpation` varchar(255) DEFAULT NULL,&lt;BR /&gt;`percussion` enum('normal','abnormal') DEFAULT NULL,&lt;BR /&gt;`auscultation` varchar(6) DEFAULT NULL,&lt;BR /&gt;`bp_systolic` int(3) DEFAULT NULL,&lt;BR /&gt;`bp_diastolic` int(3) DEFAULT NULL,&lt;BR /&gt;`sign_id` int(11) DEFAULT NULL,&lt;BR /&gt;`ChestSign_id` int(11) NOT NULL AUTO_INCREMENT,&lt;BR /&gt;`heart_rate` int(3) NOT NULL,&lt;BR /&gt;`sternal_heave` enum('present','absent') DEFAULT NULL,&lt;BR /&gt;`patient_id` int(5) DEFAULT NULL,&lt;BR /&gt;`pulse_type` enum('Normal','Dicrotic','Collapsing','Bisferiens') DEFAULT NULL,&lt;BR /&gt;`JVP` int(1) DEFAULT NULL,&lt;BR /&gt;UNIQUE KEY `ChestSign_id` (`ChestSign_id`),&lt;BR /&gt;UNIQUE KEY `ChestSign_id_2` (`ChestSign_id`)&lt;BR /&gt;) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;&lt;BR /&gt;/*!40101 SET character_set_client = @saved_cs_client */;&lt;/P&gt;&lt;P&gt;--&lt;BR /&gt;-- Dumping data for table `chestsign`&lt;BR /&gt;--&lt;/P&gt;&lt;P&gt;LOCK TABLES `chestsign` WRITE;&lt;BR /&gt;/*!40000 ALTER TABLE `chestsign` DISABLE KEYS */;&lt;BR /&gt;INSERT INTO `chestsign` VALUES (NULL,'normal',NULL,145,87,NULL,1,84,'present',23,'Collapsing',2),(NULL,'normal',NULL,135,76,NULL,2,74,'present',27,'Bisferiens',2),(NULL,'normal',NULL,115,65,NULL,3,59,'absent',28,'Bisferiens',2),(NULL,'normal',NULL,123,69,NULL,4,76,'absent',31,'Normal',3),(NULL,'normal',NULL,145,87,NULL,5,73,'absent',35,'Bisferiens',1),(NULL,'normal',NULL,165,98,NULL,6,93,'absent',38,'Dicrotic',4),(NULL,'normal',NULL,165,88,NULL,7,93,NULL,39,'Dicrotic',4),(NULL,'normal',NULL,139,75,NULL,8,83,'absent',40,'Collapsing',NULL),(NULL,'normal',NULL,136,78,NULL,9,94,'present',42,'Dicrotic',NULL);&lt;BR /&gt;/*!40000 ALTER TABLE `chestsign` ENABLE KEYS */;&lt;BR /&gt;UNLOCK TABLES;&lt;/P&gt;&lt;P&gt;--&lt;BR /&gt;-- Table structure for table `dizziness`&lt;BR /&gt;--&lt;/P&gt;&lt;P&gt;DROP TABLE IF EXISTS `dizziness`;&lt;BR /&gt;/*!40101 SET @saved_cs_client = @@character_set_client */;&lt;BR /&gt;/*!40101 SET character_set_client = utf8 */;&lt;BR /&gt;CREATE TABLE `dizziness` (&lt;BR /&gt;`dizzy_postural` enum('Postural','Non-postural') NOT NULL,&lt;BR /&gt;`dizzy_syncope` enum('Yes','No') DEFAULT NULL,&lt;BR /&gt;`dizzy_bp_systolic` int(3) NOT NULL,&lt;BR /&gt;`dizzy_bp_diastolic` int(3) NOT NULL,&lt;BR /&gt;`patient_id` int(11) DEFAULT NULL,&lt;BR /&gt;`apex_rate` int(3) DEFAULT NULL,&lt;BR /&gt;`symptom_id` int(5) DEFAULT NULL,&lt;BR /&gt;KEY `dizzyFK` (`patient_id`),&lt;BR /&gt;CONSTRAINT `dizzyFK` FOREIGN KEY (`patient_id`) REFERENCES `patient` (`patient_id`)&lt;BR /&gt;) ENGINE=InnoDB DEFAULT CHARSET=latin1;&lt;BR /&gt;/*!40101 SET character_set_client = @saved_cs_client */;&lt;/P&gt;&lt;P&gt;--&lt;BR /&gt;-- Dumping data for table `dizziness`&lt;BR /&gt;--&lt;/P&gt;&lt;P&gt;LOCK TABLES `dizziness` WRITE;&lt;BR /&gt;/*!40000 ALTER TABLE `dizziness` DISABLE KEYS */;&lt;BR /&gt;INSERT INTO `dizziness` VALUES ('Non-postural','Yes',102,86,27,NULL,NULL),('Postural','No',124,78,23,NULL,NULL),('Non-postural','No',144,78,27,NULL,NULL),('Non-postural','No',173,108,28,NULL,NULL),('Postural','No',173,108,31,NULL,NULL),('Postural','No',133,85,35,NULL,NULL),('Postural','Yes',103,65,38,NULL,NULL),('Postural','Yes',98,69,39,NULL,NULL),('Postural','Yes',98,69,39,NULL,NULL),('Postural','No',105,58,40,NULL,NULL),('Postural','Yes',111,61,42,NULL,NULL),('Postural','Yes',111,61,42,NULL,NULL),('Postural','Yes',113,72,43,NULL,NULL),('Postural','Yes',107,64,45,NULL,NULL);&lt;BR /&gt;/*!40000 ALTER TABLE `dizziness` ENABLE KEYS */;&lt;BR /&gt;UNLOCK TABLES;&lt;/P&gt;&lt;P&gt;--&lt;BR /&gt;-- Table structure for table `dyspnoea`&lt;BR /&gt;--&lt;/P&gt;&lt;P&gt;DROP TABLE IF EXISTS `dyspnoea`;&lt;BR /&gt;/*!40101 SET @saved_cs_client = @@character_set_client */;&lt;BR /&gt;/*!40101 SET character_set_client = utf8 */;&lt;BR /&gt;CREATE TABLE `dyspnoea` (&lt;BR /&gt;`dyspnoea_complex` enum('Yes','No') NOT NULL,&lt;BR /&gt;`dyspnoea_type` varchar(20) NOT NULL,&lt;BR /&gt;`dyspnoea_timing` enum('Inspiratory','Expiratory') DEFAULT NULL,&lt;BR /&gt;`dyspnoea_grade` int(1) DEFAULT NULL,&lt;BR /&gt;`patient_id` int(11) DEFAULT NULL,&lt;BR /&gt;KEY `dyspnoeaFK` (`patient_id`),&lt;BR /&gt;CONSTRAINT `dyspnoeaFK` FOREIGN KEY (`patient_id`) REFERENCES `patient` (`patient_id`)&lt;BR /&gt;) ENGINE=InnoDB DEFAULT CHARSET=latin1;&lt;BR /&gt;/*!40101 SET character_set_client = @saved_cs_client */;&lt;/P&gt;&lt;P&gt;--&lt;BR /&gt;-- Dumping data for table `dyspnoea`&lt;BR /&gt;--&lt;/P&gt;&lt;P&gt;LOCK TABLES `dyspnoea` WRITE;&lt;BR /&gt;/*!40000 ALTER TABLE `dyspnoea` DISABLE KEYS */;&lt;BR /&gt;/*!40000 ALTER TABLE `dyspnoea` ENABLE KEYS */;&lt;BR /&gt;UNLOCK TABLES;&lt;/P&gt;&lt;P&gt;--&lt;BR /&gt;-- Table structure for table `ecg`&lt;BR /&gt;--&lt;/P&gt;&lt;P&gt;DROP TABLE IF EXISTS `ecg`;&lt;BR /&gt;/*!40101 SET @saved_cs_client = @@character_set_client */;&lt;BR /&gt;/*!40101 SET character_set_client = utf8 */;&lt;BR /&gt;CREATE TABLE `ecg` (&lt;BR /&gt;`P_wave` enum('Normal','Tall','Wide','Bifid') NOT NULL,&lt;BR /&gt;`PR_interval` enum('Normal','&amp;lt;200ms','&amp;gt;400ms') NOT NULL,&lt;BR /&gt;`QRS_complex` enum('Normal','Tall','Short','M-shaped','Negative') DEFAULT NULL,&lt;BR /&gt;`ST_segment` enum('Normal','Elevated','Depressed') DEFAULT NULL,&lt;BR /&gt;`T_wave` enum('Normal','Inverted','Tall','Bifurcated') DEFAULT NULL&lt;BR /&gt;) ENGINE=InnoDB DEFAULT CHARSET=latin1;&lt;BR /&gt;/*!40101 SET character_set_client = @saved_cs_client */;&lt;/P&gt;&lt;P&gt;--&lt;BR /&gt;-- Dumping data for table `ecg`&lt;BR /&gt;--&lt;/P&gt;&lt;P&gt;LOCK TABLES `ecg` WRITE;&lt;BR /&gt;/*!40000 ALTER TABLE `ecg` DISABLE KEYS */;&lt;BR /&gt;/*!40000 ALTER TABLE `ecg` ENABLE KEYS */;&lt;BR /&gt;UNLOCK TABLES;&lt;/P&gt;&lt;P&gt;--&lt;BR /&gt;-- Table structure for table `episode`&lt;BR /&gt;--&lt;/P&gt;&lt;P&gt;DROP TABLE IF EXISTS `episode`;&lt;BR /&gt;/*!40101 SET @saved_cs_client = @@character_set_client */;&lt;BR /&gt;/*!40101 SET character_set_client = utf8 */;&lt;BR /&gt;CREATE TABLE `episode` (&lt;BR /&gt;`episode_id` int(11) NOT NULL,&lt;BR /&gt;`episode_date` date DEFAULT NULL,&lt;BR /&gt;`symptom_id` int(2) DEFAULT NULL,&lt;BR /&gt;`sign_id` int(2) DEFAULT NULL,&lt;BR /&gt;UNIQUE KEY `episode_id` (`episode_id`)&lt;BR /&gt;) ENGINE=InnoDB DEFAULT CHARSET=latin1;&lt;BR /&gt;/*!40101 SET character_set_client = @saved_cs_client */;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 19:19:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906815#M40531</guid>
      <dc:creator>advanceddriver</dc:creator>
      <dc:date>2023-12-07T19:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906822#M40532</link>
      <description>Thank you, Linus H,&lt;BR /&gt;&lt;BR /&gt;Please see my reply to Yabvon's post [which was the 2nd reply above to my Q] to see part of the sql code. in the dump file.&lt;BR /&gt;&lt;BR /&gt;In your suggestion of "find/replace", I am not sure what to replace with what tho yes there are CREATE TABLE and INSERT INTO queries therein.&lt;BR /&gt;Also, as I am using SAS ODA, I am not sure how I can install e.g. a mysql server into the server-sided file structure that appears to the left side of the screen, because my version of SAS is a learning one and I am not able to get SAS to access my desktop file structure.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for any clarification and/or sample code.&lt;BR /&gt;M</description>
      <pubDate>Thu, 07 Dec 2023 19:29:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906822#M40532</guid>
      <dc:creator>advanceddriver</dc:creator>
      <dc:date>2023-12-07T19:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906836#M40533</link>
      <description>Hi:&lt;BR /&gt;  You will not be able to install a mysql server into the SAS ODA file system. The SAS OnDemand server does not provide users with that kind of access to the operating system. And, as you have discovered, the SAS OnDemand for Academics server can only work with uploaded files, it cannot read from your local machine to access your database.&lt;BR /&gt;Cynthia</description>
      <pubDate>Thu, 07 Dec 2023 19:53:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906836#M40533</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2023-12-07T19:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906845#M40534</link>
      <description>Thank you Patrick,&lt;BR /&gt;I ran the second snippet of code in your reply - it worked or at least it did s-t without giving any errors.&lt;BR /&gt;I presume that it modified the dump file into SAS compatible sql. [I had originally created the database using mysql].&lt;BR /&gt;&lt;BR /&gt;I have tried a couple of ways to use this modified sql file but in vain.&lt;BR /&gt;I shall try and upload some code of my attempts here later [I have run out of steam for today!!].&lt;BR /&gt;&lt;BR /&gt;[Just suffice it to say that I am not sure where this new file is located tho it seems the new file would simply have overwritten the originsal dump file].</description>
      <pubDate>Thu, 07 Dec 2023 20:06:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906845#M40534</guid>
      <dc:creator>advanceddriver</dc:creator>
      <dc:date>2023-12-07T20:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906850#M40535</link>
      <description>I appreciate your input - however, if I may enquire, partly cos of Patrick's very useful input above, and partly cos I know that SAS ODA can run PROC SQL queries using files on the server, whether SAS ODA has a running sql server of its own [whatever sql syntax it uses], and how can one use this server in conjunction with an uploaded SAS-compatible database?&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Thu, 07 Dec 2023 20:16:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906850#M40535</guid>
      <dc:creator>advanceddriver</dc:creator>
      <dc:date>2023-12-07T20:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906851#M40536</link>
      <description>&lt;P&gt;Ok, thanks for the snippet. Form what I can see in the dump file it wont be easy to import it to SAS in the for it is, MySQL's syntax is too different then one used by SAS.&lt;/P&gt;
&lt;P&gt;SAS "import wizard" is dedicated for plain text files(CSVs) or Excels not for database dumps.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You wrote you did the dump yourself, have you considered dumping data to files in CSV format, which is "easily" importable into SAS ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 20:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906851#M40536</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-07T20:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906853#M40537</link>
      <description>&lt;P&gt;Most of that is gibberish to SAS (and to me).&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's look at one of the table creation blocks.&amp;nbsp; (Notice how I used the Insert Code button to paste the code into a text box.)&lt;/P&gt;
&lt;PRE&gt;--
-- Table structure for table `auscultation`
--

DROP TABLE IF EXISTS `auscultation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `auscultation` (
`FirstSound` enum('Y','N') NOT NULL,
`SecondSound` enum('Y','N') NOT NULL,
`mitralclickpresent` enum('Present','Absent') NOT NULL,
`Auscultation_id` int(1) NOT NULL,
`ChestSign_id` int(1) DEFAULT NULL,
`Murmur` enum('Y','N') NOT NULL,
UNIQUE KEY `Auscultation_id` (`Auscultation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
&lt;/PRE&gt;
&lt;P&gt;First thing I notice is those lines that start with two dashes.&amp;nbsp; I assume those a supposed to be comments of some type?&amp;nbsp; Perhaps dreaded end-of-line comments?&amp;nbsp; You will need to remove those or actually convert them into comments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next is that DROP TABLE IF syntax.&amp;nbsp; That is not valid SAS syntax.&amp;nbsp; I would just comment that out also.&amp;nbsp; SAS does not care if you try to recreate an existing table. It will happily blow away the existing one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you have some actual comments that perhaps have some special meaning to SQL server because of the ! right after the /* ?&amp;nbsp; They also have extra semicolon after the comment.&amp;nbsp; Neither the comment nor the extra semicolon will cause any trouble.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally we get to the actual CREATE TABLE statement.&lt;/P&gt;
&lt;P&gt;The first thing I notice is the use of backticks.&amp;nbsp; Not sure what flavor of SQL uses that.&amp;nbsp; If you set the DQUOTE=ANSI option on the PROC SQL statement and then convert those backticks into double quotes instead the code might work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you have that enum() thingy.&amp;nbsp; I would assume that they are trying to show the list of possible values?&amp;nbsp; You should comment that out and instead put in an actual variable TYPE there.&amp;nbsp; You would need to look at some of the actual DATA to know what they meant by that.&amp;nbsp; Did they mean that it should store 1 and 2 and display them as Y and N?&amp;nbsp; Did they mean it should store Y and N and just complain if you tried to store some other letter? Whether they want to store the display values or some code value will determine if those should be numeric variables or character variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have no idea what int(1) means as a type either.&amp;nbsp; But things are much easier in SAS.&amp;nbsp; You only have two types to worry about.&amp;nbsp; Numbers (which are 64-bit binary floating point values) and fixed length character strings.&amp;nbsp; I would assume you will want to define int(1) as num.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You also have those NOT NULL and DEFAULT NULL constraints.&amp;nbsp; Again those are generally useless in a SAS dataset.&amp;nbsp; NOT NULL SAS will accept.&amp;nbsp; DEFAULT NULL it does not.&amp;nbsp; And that is what SAS does anyway so comment it out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then there is that UNIQUE KEY ?&amp;nbsp; I assume that is somehow saying the following variable should be the key?&amp;nbsp; I would assume you would want to convert that into code to actually create an index.&amp;nbsp; You will need to make sure and remove the comma separator before it, which they inconveniently placed at the end of the line before instead of at the beginning of this line.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And that stuff after the end of the variable list does not really translate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So we end up with:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql dquote=ansi;
/*--*/
/*-- Table structure for table "auscultation"*/
/*--*/

/*DROP TABLE IF EXISTS "auscultation";*/
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "auscultation" (
"FirstSound" char(1) /*enum('Y','N')*/ NOT NULL,
"SecondSound" char(1) /*enum('Y','N')*/ NOT NULL,
"mitralclickpresent" char(7) /*enum('Present','Absent')*/ NOT NULL,
"Auscultation_id" num /*int(1)*/ NOT NULL,
"ChestSign_id" num /*int(1)*/ /*DEFAULT NULL*/,
"Murmur" char(1) /*enum('Y','N')*/ NOT NULL/*,*/
/*UNIQUE KEY "Auscultation_id" ("Auscultation_id")*/
) /*ENGINE=InnoDB DEFAULT CHARSET=latin1*/;
/*!40101 SET character_set_client = @saved_cs_client */;
create unique index  "Auscultation_id" on "auscultation"("Auscultation_id");
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which produces dataset like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1701980370715.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/90975i0410359C38E03D4C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_0-1701980370715.png" alt="Tom_0-1701980370715.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 20:19:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906853#M40537</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-12-07T20:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906855#M40538</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SAS OnDemand for Academics does &lt;U&gt;&lt;STRONG&gt;not&lt;/STRONG&gt; &lt;/U&gt;have a SQL server -- either MySQL or MS-SQL server available. PROC SQL is primarily intended for students and independent learners to learn how to use the SQL procedure, at the level that we teach in the Programming 1 and SQL 1 classes. We do NOT use any external databases in these classes.&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 20:40:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906855#M40538</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2023-12-07T20:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906859#M40539</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/178713"&gt;@advanceddriver&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you Patrick,&lt;BR /&gt;I ran the second snippet of code in your reply - it worked or at least it did s-t without giving any errors.&lt;BR /&gt;I presume that it modified the dump file into SAS compatible sql. [I had originally created the database using mysql].&lt;BR /&gt;....&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/178713"&gt;@advanceddriver&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the sample code there was this bit where you would need to write code that modifies the text you read from your source file so it becomes SAS syntax.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1701984806162.png" style="width: 539px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/90976i50408C3DCFA9D164/image-dimensions/539x37?v=v2" width="539" height="37" role="button" title="Patrick_0-1701984806162.png" alt="Patrick_0-1701984806162.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking into the MySQL docu it appears you can also export to json files.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://dev.mysql.com/doc/workbench/en/wb-admin-export-import.html" target="_blank" rel="noopener"&gt;https://dev.mysql.com/doc/workbench/en/wb-admin-export-import.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://dev.mysql.com/doc/workbench/en/wb-admin-export-import-table.html" target="_blank" rel="noopener"&gt;https://dev.mysql.com/doc/workbench/en/wb-admin-export-import-table.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1701985696068.png" style="width: 779px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/90987i0C36EB4715E4BCC3/image-dimensions/779x104?v=v2" width="779" height="104" role="button" title="Patrick_0-1701985696068.png" alt="Patrick_0-1701985696068.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If the mysql export wizard gives you the option then exclude all constraints. You don't need them for your purpose.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reading such a json file into SAS would likely be more straightforward. SAS got a json engine and you'll find sample code how to read a json using SAS.&lt;/P&gt;
&lt;P&gt;I suggest you give it a go and if you get stuck reading the json into SAS tables then share the full json for one table here as attachment.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 22:04:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906859#M40539</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-12-07T22:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906911#M40545</link>
      <description>&lt;P&gt;See&amp;nbsp;&lt;A href="https://www.databasestar.com/mysql-output-file/#:~:text=slow%20and%20manual.-,Save%20MySQL%20Results%20to%20a%20File,OUTFILE%20'%2Ftemp%2Fmyoutput." target="_blank" rel="noopener"&gt;here&lt;/A&gt;&amp;nbsp;for how to export MySQL data to a text file, which can easily be read with a DATA step.&lt;/P&gt;
&lt;P&gt;In the end, writing that DATA step will be (much) faster than converting the dumpfile to SAS SQL code.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Dec 2023 21:34:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/906911#M40545</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-12-09T21:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/907172#M40557</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for this detailed info - in my experience, SAS sql is not v different from e.g. mysql or postgres sql - I think the "gibberish" is cos my data was copied from a dump file, in which some inbuilt mechanism has created e.g. the double dashes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have my original mysql code for the whole database, which appears to be v similar to SAS sql as in the code you have provided.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My residual problem is now that SAS does not accept "CREATE DATABASE" or "USE DATABASE" [which is standard sql format in e.g. mysql], so [and this will sound so simple to you I am sure], but if I create all my tables and insert all the data [for which I have all the "INSERT INTO" code lines, how do I make them all reside in a single [named] database? I need to subsequently run sql SELECT queries using PROC SQL with multiple tables with specific relationship types e.g. I need to use INNER JOIN, CROSS JOIN, etc. The member named&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/38890"&gt;@cynthia&lt;/a&gt;&amp;nbsp;is, as far as I can see, a business person with little techniocal knowledge cos she just points out what cannot be done rather than helping with what can, bordering on a sales pitch for the full package. For instance, her theory is that PROC SQL can handle only basic queries, WHEREAS it is clear from the logs and from the tooltips within PROC SQL in SAS ODA that the system can handle various types of joins as well as run queries from multiple tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder if you would be able to help out with this task i.e. to create and save several tables to a single database/file so that I can run queries using multiple tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again in advance, Tom!&lt;/P&gt;</description>
      <pubDate>Sat, 09 Dec 2023 21:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/907172#M40557</guid>
      <dc:creator>advanceddriver</dc:creator>
      <dc:date>2023-12-09T21:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/907173#M40558</link>
      <description>&lt;P&gt;In SAS a single level dataset name NORMALLY refers to a dataset in the WORK library.&lt;/P&gt;
&lt;P&gt;So you could just make the datasets in WORK and and then copy them to some other library.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mylib 'mydirectory name';
proc sql;
%include 'mycode.sql'/source2;
quit;
proc copy inlib=work outlib=mylib;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But it also has the USER setting that will cause single level dataset name to refer to a different libref instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The original and simplest way is to define a libref named USER and then SAS will automatically use that.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname user 'mydirectory name';
proc sql;
%include 'mycode.sql') / source2;
quit;
libname user clear;
libname mylib 'mydirectory name';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are now more complex ways using the USER system option.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Dec 2023 21:09:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/907173#M40558</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-12-09T21:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/907174#M40559</link>
      <description>EDIT:&lt;BR /&gt;I meant &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&lt;BR /&gt;NOT:&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/38890"&gt;@cynthia&lt;/a&gt;</description>
      <pubDate>Sat, 09 Dec 2023 21:13:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/907174#M40559</guid>
      <dc:creator>advanceddriver</dc:creator>
      <dc:date>2023-12-09T21:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/907188#M40565</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for this suggestion, Kurt.&amp;nbsp; I might try it out tho my gut feeling is that the file will be read by SAS in a format other than what I can run SQL queries on [even if I save the file as a .csv, which another member has suggested]; my whole aim of this exercise is to run sql queries within SAS ODA [using PROC SQL] cos I am helping a "student" who needs to learn to do just that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In his work setting, his employers have provided him with the full SAS desktop package, so later there may not be an issue in reading [actually quite large and diverse] databases into SAS - it is during the current learning period that I need to achieve whatever is possible/permissible in SAS ODA.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Dec 2023 11:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/907188#M40565</guid>
      <dc:creator>advanceddriver</dc:creator>
      <dc:date>2023-12-10T11:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/907190#M40567</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/178713"&gt;@advanceddriver&lt;/a&gt;&amp;nbsp;The easiest way to copy data from a database to SAS is by using one of the SAS Access engines. For this to work you need the access engine (like ODBC) licensed and have a connection to the database configured.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that's not the case then you need the SQL - and many databases have extensions to standard SQL and though often generate code that only runs on the specific database without any changes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you've got the Create Table SQLs from your database then you can try and run it "as is" using SAS - but there is a good chance it's not 100% SAS SQL compliant code so you will have to figure out what needs change.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The other option is an export in json format. There you have a good chance that you can read these json's directly with SAS and that this will create the tables in SAS.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Dec 2023 12:02:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/907190#M40567</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-12-10T12:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Importing sql dump file into SAS Studio ODA</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/907242#M40581</link>
      <description>&lt;P&gt;You need to write the data step in such a way that it replicates the database table structure&amp;nbsp;&lt;EM&gt;as closely as possible&lt;/EM&gt;. Keep in mind that SAS has only two datatypes, character and numeric, so stuff like the enumerated columns has to be mapped to something which makes sense.&lt;/P&gt;
&lt;P&gt;E.g. a column with values Y and N is best converted to numeric 1 and 0, with a display format to show the characters (the variable can then be used directly in conditions).&lt;/P&gt;
&lt;P&gt;Any resulting dataset can be used in PROC SQL, no matter how it was created.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 08:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-sql-dump-file-into-SAS-Studio-ODA/m-p/907242#M40581</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-12-11T08:16:43Z</dc:date>
    </item>
  </channel>
</rss>

