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

Need Rexx Program to Load in to DB2 Table


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Hareesh Verma

New User


Joined: 08 Mar 2016
Posts: 8
Location: india

PostPosted: Tue Sep 20, 2016 2:59 pm
Reply with quote

Hi

I Need REXX Program to Read from Sequential File and load that data in to DB2 Table.

If any One help me Please let me know.

Thanks in Advance.

Regards
Hareesh
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue Sep 20, 2016 4:44 pm
Reply with quote

Let me start out by saying I am a Rexx guy. I use it for many things.

But loading data into a DB2 table from a sequential file, would be way down on my list of practical uses.

Why not use a DB2 utility? Much more efficient and easy to write cards for.

Next, I need a new car. If any One help me, please let me know.

We have the same chance at getting help asking this way.

If you give some specifics, perhaps some help is possible, but right now, not so much.
Back to top
View user's profile Send private message
Kerry Ropar

New User


Joined: 14 Sep 2016
Posts: 25
Location: Australia

PostPosted: Tue Sep 20, 2016 4:53 pm
Reply with quote

Hareesh,

Your problem statement is fairly wide open. May I please request you to provide more details on selecting this approach. Is there any further restrictions which forced you to select rexx when this can be done with simple jcl.
Back to top
View user's profile Send private message
Hareesh Verma

New User


Joined: 08 Mar 2016
Posts: 8
Location: india

PostPosted: Tue Sep 20, 2016 5:19 pm
Reply with quote

Actually I am not Allowed to use Load Utility. Writing a Cobol Program Means Too Many Components(PROG,PROC,PLAN) etc which can be completed with a single Parm using REXX.
Back to top
View user's profile Send private message
Kerry Ropar

New User


Joined: 14 Sep 2016
Posts: 25
Location: Australia

PostPosted: Tue Sep 20, 2016 5:27 pm
Reply with quote

Quote:
Actually I am not Allowed to use Load Utility.


Can you please let me know what you are thinking here. May be I am too new to Mainframe, but if not load utility, then how do you expect rexx to load into table? Do you want Insert statements?

Quote:
Writing a Cobol Program


We are not advising this. We are suggesting load utility which can be executed directly using JCL.
Back to top
View user's profile Send private message
Hareesh Verma

New User


Joined: 08 Mar 2016
Posts: 8
Location: india

PostPosted: Tue Sep 20, 2016 5:30 pm
Reply with quote

Yes By using Insert Statements.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Sep 20, 2016 5:54 pm
Reply with quote

Why not read up in the SQL manual about how to write DB2/Rexx programs?
Yes, the required information is there - an entire chapter. I know because that is what I did.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue Sep 20, 2016 5:55 pm
Reply with quote

How familiar are you with Rexx?

The Rexx/DB2 interface is not the best. It is not as easy to work with as you think.

Your profile says you are a beginner.

I have 30 years experience with Rexx, Cobol, DB2, JCL etc...

I would not choose Rexx to do this. I would choose a DB2 utility first, then Cobol next.

You come to this forum for advice, and now you have it.

The person who said you can not use a utility should first be fired, then shot.
icon_wink.gif
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Sep 20, 2016 6:50 pm
Reply with quote

Quote:
first be fired, then shot.

Rather than shot then fired. Easier to drag them out the door that way.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Tue Sep 20, 2016 7:21 pm
Reply with quote

My first choice would be the DB2 LOAD utility. So would my second and third choices. Inserting data via DSNREXX calls is very inefficient and would be a poor choice for more than a handful of rows.

If you must use Rexx, another approach is to read your input file and format SQL INSERT statements that you can run in a subsequent step via DSNTEP2. Even this approach is not optimal; you can do the same thing with relatively little effort (and much more efficiently) using DFSORT to format the INSERT statements.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Tue Sep 20, 2016 10:58 pm
Reply with quote

Direct the moronic idiot who told you not to use the LOAD utility to this page...
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue Sep 20, 2016 11:43 pm
Reply with quote

Hareesh Verma wrote:
Actually I am not Allowed to use Load Utility. Writing a Cobol Program Means Too Many Components(PROG,PROC,PLAN) etc which can be completed with a single Parm using REXX.


I note that you have not said why you are not allowed to use the LOAD utility. If there is a sound reason, then we may be able to assist you in a way that does not involve writing a Rexx exec (which Messrs. Leahy and Porcelan have told to you to avoid). If it's an arbitrary "It's the requirement!", then I recommend that you push back.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Sep 20, 2016 11:59 pm
Reply with quote

IMO topics which develop like this one,
- requirements/ solutions against any good judgement and good practices-
should be locked after a while.

that what I will probably do shortly.
no reason to waste time on moronic requirements
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Wed Sep 21, 2016 12:38 am
Reply with quote

Quote:
Writing a Cobol Program Means Too Many Components(PROG,PROC,PLAN) etc which can be completed with a single Parm using REXX
So what? Develop the components. I don't think it will take more than 30 minutes.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Wed Sep 21, 2016 1:23 am
Reply with quote

Rohit Umarjikar wrote:
Quote:
Writing a Cobol Program Means Too Many Components(PROG,PROC,PLAN) etc which can be completed with a single Parm using REXX
So what? Develop the components. I don't think it will take more than 30 minutes.

+1

I once wrote a small CICS inquiry system, made up of five PL/I programs and two BMS maps, before my coffee break. ;)
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Sep 21, 2016 1:41 am
Reply with quote

It think the OP has been scared off anyway. icon_neutral.gif
Back to top
View user's profile Send private message
Kerry Ropar

New User


Joined: 14 Sep 2016
Posts: 25
Location: Australia

PostPosted: Wed Sep 21, 2016 4:41 am
Reply with quote

Terry Heinze wrote:
Quote:
first be fired, then shot.

Rather than shot then fired. Easier to drag them out the door that way.


May be he meant to save work-site compensation claims as well icon_lol.gif

Anyways, unless the user gives us a reason to follow this approach, we all should just wait to hear back for a while (just a suggestion)
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Sep 21, 2016 5:24 am
Reply with quote

Quote:
Anyways, unless the user gives us a reason to follow this approach


we will get as usual the stupid reply that' s the requirement
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Wed Sep 21, 2016 9:20 am
Reply with quote

Quote:
I have 30 years experience with Rexx, Cobol, DB2, JCL etc...
thats my exact age icon_eek.gif
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Wed Sep 21, 2016 10:08 am
Reply with quote

Rohit Umarjikar wrote:
Quote:
I have 30 years experience with Rexx, Cobol, DB2, JCL etc...
thats my exact age icon_eek.gif

So a number of us have been in this racket long than you've been alive icon_wink.gif
Back to top
View user's profile Send private message
Hareesh Verma

New User


Joined: 08 Mar 2016
Posts: 8
Location: india

PostPosted: Wed Sep 21, 2016 10:11 am
Reply with quote

Thank you all for advice. That work has been Assigned to another Resource.

icon_biggrin.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Wed Sep 21, 2016 11:30 am
Reply with quote

Hahaha, Well get done .. Hope he/she don't repeat the same post here again.
Back to top
View user's profile Send private message
Kerry Ropar

New User


Joined: 14 Sep 2016
Posts: 25
Location: Australia

PostPosted: Thu Sep 22, 2016 7:37 am
Reply with quote

Rohit Umarjikar wrote:
Hahaha, Well get done .. Hope he/she don't repeat the same post here again.


Or may be he can share this information with new resource creating a base for his/her design.
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Load new table with Old unload - DB2 DB2 6
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top