Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1932
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: 10374
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: 26
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: 1932
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 query to fetch record which has only ... maxsubrat DB2 10 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Squeeze record left so that zeroes ar... Vignesh Sid SYNCSORT 5 Fri Nov 10, 2017 1:40 pm
No new posts NULLFILE on ICEGENER Utility Ashishpanpaliya DFSORT/ICETOOL 5 Wed Nov 08, 2017 10:45 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us