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

need rexx code for taking table name and giving dclgen forit


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

Active User


Joined: 13 Jul 2007
Posts: 128
Location: Guntur

PostPosted: Wed Feb 06, 2008 2:53 pm
Reply with quote

Hi All,

I am trying to create a rexx code which will take input as table name and give the respective dclgen for it as output

i have a file with all the information of it like given below

Code:

Table_Name       Dclgen

Table1                Dclgen1
Table2                Dclgen2
Table3                Dclgen3
Table4                Dclgen4



Can anyone help me out in this concern
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Wed Feb 06, 2008 3:41 pm
Reply with quote

Hi,
You can customize the following CLIST code for your needs.

PROC 0
DSN SYSTEM(DSN)
DCLGEN TABLE(OWNER.TABLE_NAME) +
LIBRARY('HLQ.DCLGENL(MEMBER)') +
ACTION(REPLACE) LANGUAGE(COBOL)
END
EXIT

Read each record from the file and put the above code in a loop etc, etc.

Thanks,
Sri Hari G.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Feb 06, 2008 3:44 pm
Reply with quote

Not straight-forward, but doable.

You need to access DB2 catalog tables (aka SYSIBM), and get all the definitions of columns in the table. Then you need to use the fine manual that describes how to convert DB2 formats into COBOL formats, and generate the DCLGEN.

By the way, why you want to invent the wheel? DCLGEN is a free utility that comes with DB2... why not using it?

O.
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 128
Location: Guntur

PostPosted: Wed Feb 06, 2008 4:25 pm
Reply with quote

Hi,

you have miss understood my requirement,

i need rexx program or macro which will get me the dclgen member name for the respective table name which i give as in put in the command
like given below

tso dgen vtm_gnrt_invent

where vtm_gnrt_invent is table name,output should come as dclgen name for that table which i have already found it and pasted in the file as mentioned above.

when i give i/p as table name it should open the file and take the dclgen member name and display it on the screen
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Feb 06, 2008 4:28 pm
Reply with quote

So, what is the problem? Reading a dataset using REXX?

O.
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 128
Location: Guntur

PostPosted: Wed Feb 06, 2008 4:32 pm
Reply with quote

Hi

If you don't mind can you give the rexx code for that, Because long back i have used rexx and forgot everything
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Wed Feb 06, 2008 5:00 pm
Reply with quote

so if the question is how to read in Rexx the dataset where the DCLGEN is stored? THEN try the wonderful Search facility in this forum!

tip: search for DISKR

;)
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Feb 06, 2008 5:01 pm
Reply with quote

Well, reading datasets in REXX is one of the basics. It even has it own chapter in the manuals, not to mention lots of discussions here in the forum (hint: look for EXECIO).

O.
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 128
Location: Guntur

PostPosted: Thu Feb 07, 2008 4:45 pm
Reply with quote

Hi All,

Thanks for your valuable tips now a new problem i am facing,
i wrote rexx code for it but the problem is i am able to run it only in my pc and only with my racf id,is there any way to run this code in all of my friends pc's with their racf id's icon_question.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Thu Feb 07, 2008 4:53 pm
Reply with quote

balakrishna reddy wrote:
snip snip
...
the problem is i am able to run it only in my pc and only with my racf id,is there any way to run this code in all of my friends pc's with their racf id's icon_question.gif


I would like to straighten up the terminology a little bit
the issue is not pc related, but tso userid related

if You are able to logon to tso from a different pc with Your userid
You will certainly be able to carry on your usual work
( unless also terminal security has been enforced )

I guess You stored the rexx script in a ..personal.. library concatenated
to sysproc/sysexec

You should contact Your system support group and ask about a sharable
library where to store common tools ( rexx/clist)
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 128
Location: Guntur

PostPosted: Thu Feb 07, 2008 5:13 pm
Reply with quote

once i logoff my racf-id and again login into it and try to run my rexx code without allocating the file it is giving error.

any solution is there so that i can permanently allocate the file
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Thu Feb 07, 2008 5:17 pm
Reply with quote

did You read the lat two lines of my previous post icon_confused.gif
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 Run rexx with JCL Job CLIST & REXX 1
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts REXX/CMS How to place command console... CLIST & REXX 4
Search our Forums:

Back to Top