IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can we insert the sequential dataset records to a DB2 table?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Suja K

New User


Joined: 03 Mar 2008
Posts: 16
Location: Hyderabad

PostPosted: Fri Feb 20, 2009 12:26 pm
Reply with quote

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
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Fri Feb 20, 2009 1:57 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Feb 20, 2009 9:50 pm
Reply with quote

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
View user's profile Send private message
Suja K

New User


Joined: 03 Mar 2008
Posts: 16
Location: Hyderabad

PostPosted: Sat Feb 21, 2009 4:12 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Sat Feb 21, 2009 5:40 pm
Reply with quote

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
View user's profile Send private message
Suja K

New User


Joined: 03 Mar 2008
Posts: 16
Location: Hyderabad

PostPosted: Tue Feb 24, 2009 3:49 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 24, 2009 4:13 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Load new table with Old unload - DB2 DB2 6
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top