Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

ADD sysrec's to job depending upon certain conditions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: ADD sysrec's to job depending upon certain conditions
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: 8593
Location: Back in jolly old England

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

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

Senior Member


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

PostPosted: Sun Nov 30, 2008 10:11 pm    Post subject: Reply to: ADD sysrec's to job depending upon certain conditi
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    Post subject: Reply to: ADD sysrec's to job depending upon certain conditi
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

Senior Member


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

PostPosted: Sun Dec 07, 2008 8:51 am    Post subject: Reply to: ADD sysrec's to job depending upon certain conditi
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: 1226
Location: Israel

PostPosted: Sun Dec 07, 2008 10:20 pm    Post subject:
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    Post subject: Not able to find out these commands , please help me
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: 8593
Location: Back in jolly old England

PostPosted: Tue Dec 09, 2008 5:12 pm    Post subject:
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: 1226
Location: Israel

PostPosted: Tue Dec 09, 2008 7:23 pm    Post subject: Reply to: ADD sysrec's to job depending upon certain conditi
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    Post subject: let me try this , i will back to u if any doubts
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    Post subject: more than expected number of entries are getting inserted
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: 1226
Location: Israel

PostPosted: Wed Dec 10, 2008 7:26 pm    Post subject: Reply to: ADD sysrec's to job depending upon certain conditi
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    Post subject: It is working fine now
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts DFSORT report with multiple conditions Bill Woodger DFSORT/ICETOOL 9 Wed Jan 20, 2016 2:19 am
No new posts Add Trailing Zeroes depending upon th... Rohit Umarjikar DFSORT/ICETOOL 3 Fri Oct 23, 2015 1:47 am
No new posts Multiple OCCURS depending on in same ... muralirajansm COBOL Programming 6 Fri Aug 21, 2015 4:23 pm
No new posts 3-D Table with nested DEPENDING ON Cl... VivekKhanna COBOL Programming 5 Sat Aug 08, 2015 11:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us