Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

any way to insert the record to table without using utility

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Mon Jun 29, 2015 7:24 pm    Post subject: any way to insert the record to table without using utility
Reply with quote

HI,

I want insert the records from a ps file into a table using REXX without using any utilities.

I gave some 5 fields in my ps file and the field data type of the those fields will be same as what is present into the destination table where i want to load the file. How can I do this....?

and the number of fields in the ps file and the table may differ always. but both will always have same number of fields. like if ps file has 10 fields then table will also have 10 fields and if ps file has 50 table will have 50.

So I want to dynamically insert the records into the table....

Any help from you people will be very greatful.....

Thanks,
Sakrat
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1713
Location: UK

PostPosted: Mon Jun 29, 2015 9:05 pm    Post subject:
Reply with quote

Have you looked at how to access DB2 via Rexx in the SQL Users Guide?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Jun 29, 2015 10:24 pm    Post subject: Reply to: any way to insert the record to table without using utility
Reply with quote

Quote:
I want insert the records from a ps file into a table using REXX without using any utilities.

You will have to write a program,
the logic will not depend on the language being used icon_cool.gif
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue Jun 30, 2015 12:22 pm    Post subject:
Reply with quote

My Question is not about the INSERT syntax it is like when i have fields that may vary not contant number of fields, in that case how will i write the INSERT syntax statement.
Back to top
View user's profile Send private message
Smita.t2

New User


Joined: 17 Apr 2012
Posts: 22
Location: Bangalore

PostPosted: Tue Jun 30, 2015 12:34 pm    Post subject:
Reply with quote

Dynamic sql?
please check below link for sample program.

http://www-01.ibm.com/support/knowledgecenter/SSEPEK_11.0.0/com.ibm.db2z11.doc.apsg/src/tpc/db2z_samplerexxapp.dita
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue Jun 30, 2015 12:38 pm    Post subject:
Reply with quote

Smita.t2 wrote:
Dynamic sql?
please check below link for sample program.

http://www-01.ibm.com/support/knowledgecenter/SSEPEK_11.0.0/com.ibm.db2z11.doc.apsg/src/tpc/db2z_samplerexxapp.dita


Can I use the below to insert the records in the ps file to the db2 table.

Code:


DRAW schemaname.tablename (TYPE=INSERT SSID=***

Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1713
Location: UK

PostPosted: Tue Jun 30, 2015 3:34 pm    Post subject:
Reply with quote

What language is that? You asked about Rexx and that is not Rexx.

As to a variable number of fields then you code your program to do that. but your program needs to know the format of any data that is passed to it. How you do that is up to you but you may want to read in not only the dataset but also the DCLGEN for the table that is to be updated.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Best IMS DB Unload Utility jjabez10 IMS DB/DC 12 Thu Sep 22, 2016 11:15 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us