View previous topic :: View next topic
|
Author |
Message |
Suja K
New User
Joined: 03 Mar 2008 Posts: 16 Location: Hyderabad
|
|
|
|
Could anyone please tell me if we can insert the records from a sequential dataset directly into a table in one PROC SQL step?
When i searched i only got the code for which the literals are given rather than the program variables.
Could you please give me the sample code as well.
=============
Thanks in advance,
Suja |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Suja,
Quote: |
... PROC SQL step? |
What do you mean by this?
You can use IBM Load utility or BMC Load plus or some other third party utilites to insert the data set records into table... even your own program will do it. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you search the forum for "LOAD" rather than "INSERT".
Insert typically refers to single row inserting (even if many qsam records are read, each insert is for one row). Load typically refers to a bulk of data, rather than one row at a time.
If you find something that is not clear, post what youfound and your question - someone will be able to clarify. |
|
Back to top |
|
|
Suja K
New User
Joined: 03 Mar 2008 Posts: 16 Location: Hyderabad
|
|
|
|
I have already tried the DBLOAD utility in SAS.
But the column name of the DB2 table to be inserted is more than 8 characters and the SAS variable name cannot be more than 8.
So the assignment is failing. can anyone tel me a remedy for that?
IS there any other option? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
and the SAS variable name cannot be more than 8. |
Which version of SAS are you running? This is not true in SAS 9 -- the limit is now 32 characters for a variable name -- and IIRC this has been true for some time; since 8.2 or maybe earlier? |
|
Back to top |
|
|
Suja K
New User
Joined: 03 Mar 2008 Posts: 16 Location: Hyderabad
|
|
|
|
the version is SAS 9.1.3.
Below is the code
DATA XYZ;
INFILE file1;
INPUT @001 LEVEL $6.
@008 LEVEL_DESC $30.;
ERROR: The variable named LEVEL_DESC contains more than 8 characters. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
It's not complaining about the variable name, it's complaining about the variable. SAS character variables are 8 bytes in length unless you use a LENGTH statement to state otherwise:
Code: |
DATA XYZ;
INFILE file1;
LENGTH LEVEL_DESC $ 30 ;
INPUT @001 LEVEL $6.
@008 LEVEL_DESC $30.; |
|
|
Back to top |
|
|
|