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

ADD sysrec's to job depending upon certain conditions


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pdighade

New User


Joined: 21 Jul 2008
Posts: 40
Location: pune

PostPosted: Sun Nov 30, 2008 12:52 pm
Reply with quote

I want to Read a query dataset containing number of queries and I want to find out number of tables impacted by query through a REXX program, I want to take backup of those table using unload job.
I have a skeleton (unload job) to take backup of table

//step1 exec pgm=dsniaul

//

----
//syspunch dd dummy
//sysrec00 dd dsn=a
//sysrec01 dd dsn =b
//sysrec02 dd dsn =c
//sysin dd *
select * from tablea
select * from tableb
select * from tablec
/*
//


This job will unload tablea in sysrec00 ,tableb in sysrec01 etc...

Now my question is ..If 5 tables are getting impacted then I need to add 5
sysrec's in this job . How can I add to this job and one thing I dont want to hardcode these sysrec's , I want to add them run time through REXX program or by any logic.

Please help me out..........
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sun Nov 30, 2008 2:44 pm
Reply with quote

ISPF file tailoring services - in the ISPF manuals.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Sun Nov 30, 2008 10:11 pm
Reply with quote

Quote:
one thing I dont want to hardcode these sysrec's

I think you still need to hardcode them somewhere.

It would be easier if you changed your naming convention, how about something like this:
Code:
//syspunch dd dummy
//tablea dd dsn=mydsn.tablea
//tableb dd dsn=mydsn.tableb
//tablec dd dsn=mydsn.tablec
//sysin dd *
select * from tablea
select * from tableb
select * from tablec
/*
//

With like changes in your application programs.
Back to top
View user's profile Send private message
pdighade

New User


Joined: 21 Jul 2008
Posts: 40
Location: pune

PostPosted: Sat Dec 06, 2008 9:55 am
Reply with quote

But still is there any way we cad add dd stament at run time.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Sun Dec 07, 2008 8:51 am
Reply with quote

You need to use the ISPF file tailoring to build a second job and then submit it to do the actual work.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Sun Dec 07, 2008 10:20 pm
Reply with quote

First create an ISPF table with 2 fields: SYSREC number and Table name .
Fill the table with the names you want to backup.
Use the ISPF file tailoring. The skeleton would contain )DOT around the SYSREC DD and another one around the SELECT.

Check the TBCREATE and TBADD commands in the ISPF Services Guide.
Check the )DOT in the Dialog Developer's Guide.
Back to top
View user's profile Send private message
pdighade

New User


Joined: 21 Jul 2008
Posts: 40
Location: pune

PostPosted: Tue Dec 09, 2008 3:59 pm
Reply with quote

I tried to find out these commands ,but not abel to find ,
Can you please explain me with one e.g
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Dec 09, 2008 5:12 pm
Reply with quote

Click HERE to find the ISPF services manual.

All will be revealed.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Dec 09, 2008 7:23 pm
Reply with quote

Just to make easy things easy, here is more information

The skeleton:
Code:
//syspunch dd dummy
)DOT BKUPTBL
//sysrec&RECNUM dd dsn=&RECDSN
)ENDDOT
//sysin dd *
)DOT BKUPTBL
select * from &RECTBN
)ENDDOT
/*
It means: for each entry in ISPF table "BKUPTBL", create lines (the ones between )DOT and )ENDDOT).
In each line replace the variables with their values from the table.

For the skeleton to work, you now have to create the ISPF table (in the REXX program):
Code:
Address ISPEXEC "TBCREATE BKUPTBL NAMES(RECNUM RECDSN RECTBN) NOWRITE"


And of course load the table:
Code:
RECNUM = Right(sysrecnum,2,'0')   /* counter for SYSRECnn */
RECDSN = 'MYPREF.MYBACKUP.'tablename   /* backupfile dsn */
RECTBN = tablename
Address ISPEXEC "TBADD BKUPTBL"
Back to top
View user's profile Send private message
pdighade

New User


Joined: 21 Jul 2008
Posts: 40
Location: pune

PostPosted: Tue Dec 09, 2008 9:48 pm
Reply with quote

thanks for help
Back to top
View user's profile Send private message
pdighade

New User


Joined: 21 Jul 2008
Posts: 40
Location: pune

PostPosted: Wed Dec 10, 2008 1:47 pm
Reply with quote

The logic is woking but more than expected number of entries are getting inserted in the skel . Do i need initialize the table
? and how to display no of rows in table without panel , jsut display the rows through rexx program
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Dec 10, 2008 7:26 pm
Reply with quote

You can SAY the variables each time after (or before) the TBADD.
You should add a TBEND to close the table without saving.
Use TRACE to see what the program does.

There are other commands that work with ISPF tables: TBQUERY, TBSKIP and TBGET, for example, can be used to check/display the table contents.
Back to top
View user's profile Send private message
pdighade

New User


Joined: 21 Jul 2008
Posts: 40
Location: pune

PostPosted: Wed Dec 10, 2008 11:52 pm
Reply with quote

I have closed the table with TBCLOSE

thanks for your help
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts How to load to DB2 with column level ... DB2 6
No new posts Db2 SQL - how to switch among differe... DB2 18
No new posts To search DB2 table based on Conditio... DB2 1
No new posts How can I select certain file dependi... JCL & VSAM 12
This topic is locked: you cannot edit posts or make replies. How can I select certain file dependi... Compuware & Other Tools 1
Search our Forums:

Back to Top