View previous topic :: View next topic
|
Author |
Message |
Hareesh Verma
New User
Joined: 08 Mar 2016 Posts: 8 Location: india
|
|
|
|
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 |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
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 |
|
|
Kerry Ropar
New User
Joined: 14 Sep 2016 Posts: 25 Location: Australia
|
|
|
|
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 |
|
|
Hareesh Verma
New User
Joined: 08 Mar 2016 Posts: 8 Location: india
|
|
|
|
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 |
|
|
Kerry Ropar
New User
Joined: 14 Sep 2016 Posts: 25 Location: Australia
|
|
|
|
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 |
|
|
Hareesh Verma
New User
Joined: 08 Mar 2016 Posts: 8 Location: india
|
|
|
|
Yes By using Insert Statements. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
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.
|
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
Quote: |
first be fired, then shot. |
Rather than shot then fired. Easier to drag them out the door that way. |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1314 Location: Vilnius, Lithuania
|
|
|
|
Direct the moronic idiot who told you not to use the LOAD utility to this page... |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1314 Location: Vilnius, Lithuania
|
|
|
|
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 |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
It think the OP has been scared off anyway. |
|
Back to top |
|
|
Kerry Ropar
New User
Joined: 14 Sep 2016 Posts: 25 Location: Australia
|
|
|
|
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
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Quote: |
I have 30 years experience with Rexx, Cobol, DB2, JCL etc...
|
thats my exact age |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Rohit Umarjikar wrote: |
Quote: |
I have 30 years experience with Rexx, Cobol, DB2, JCL etc...
|
thats my exact age |
So a number of us have been in this racket long than you've been alive |
|
Back to top |
|
|
Hareesh Verma
New User
Joined: 08 Mar 2016 Posts: 8 Location: india
|
|
|
|
Thank you all for advice. That work has been Assigned to another Resource.
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Hahaha, Well get done .. Hope he/she don't repeat the same post here again. |
|
Back to top |
|
|
Kerry Ropar
New User
Joined: 14 Sep 2016 Posts: 25 Location: Australia
|
|
|
|
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 |
|
|
|