Table Unload Help!



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Table Unload Help!

Postby gokulNmf » Tue Apr 21, 2009 12:37 pm

Hi,

I have a file “F1” which has few records; I want to unload a table into a file “F2” where the primary key “PK1” of the table has the value equal to the F1’s.
I want to unload with the utility(IKJEFT01) in a job step. My query is in a parm card. So I need a dynamic parm card, is it possible?

Where can i get the details abt the utility IKJEFT01?

Thanks and Regards,
GK
Cheers,
Gokul
User avatar
gokulNmf
 
Posts: 114
Joined: Sat Mar 28, 2009 6:41 pm
Location: India
Has thanked: 0 time
Been thanked: 0 time

Re: Table Unload Help!

 

Re: Table Unload Help!

Postby MrSpock » Tue Apr 21, 2009 3:57 pm

gokulNmf wrote:Hi,

I have a file “F1” which has few records; I want to unload a table into a file “F2” where the primary key “PK1” of the table has the value equal to the F1’s.
I want to unload with the utility(IKJEFT01) in a job step. My query is in a parm card. So I need a dynamic parm card, is it possible?

Where can i get the details abt the utility IKJEFT01?

Thanks and Regards,
GK


I have no idea what you're talking about in the first part and how that's JCL-related.

As far as the second part:

APPENDIX1.1 Appendix A. Executing the terminal monitor program from the z/OS V1R10.0 TSO/E Customization manual.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: Table Unload Help!

Postby swd » Tue Apr 21, 2009 6:24 pm

Hmmmmmmmmmmm... sounds like a DB2 question to me (if I actually understand the post!)

I think you really want to know about the DB2 unload utility DSNTIAUL. This will have an SQL statement as the SYSIN input, along the lines of

SELECT * FROM DB2.TABLE
WHERE PK1 IN ('F1VALUE1', 'F1VALUE2' etc...)

I think you'll need a program to read through your F1 file and create the SQL SYSIN Parmfile which will be the SQL statement into the DB2 unload. The program can get the values you need from File F1 and put these into the SQL statement (F1VALUE1, F1VALUE2 etc..).

IKJEFT01 is the Program the will run the DSNTIAUL unload utility

//STP020 EXEC PGM=IKJEFT01,REGION=4096K,DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DSN1)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARM('SQL') -
LIB('CSOFT.DSN1.RUNLIB.LOAD')
//SYSIN DD *
SELECT * FROM DB2.TABLE
WHERE PK1 IN ('F1VALUE1', 'F1VALUE2' etc...)
/*

This is my understanging of this post. I could be wrong....

Cheers
Steve
User avatar
swd
 
Posts: 109
Joined: Wed Feb 18, 2009 9:18 pm
Location: UK
Has thanked: 0 time
Been thanked: 0 time

Re: Table Unload Help!

Postby swd » Tue Apr 21, 2009 6:35 pm

Another thought. If you load your F1 file to a DB2 table, you can then keep the same static SQL parm used to unload your table based on the contents of file F1

SELECT * FROM DB2.TABLE
WHERE PK IN (SELECT PRIMARY KEY FROM F1LOADEDTABLE)

If you get my meaning. So you load replace F1LOADEDTABLE with the contents of the F1 file, giving you your unload criteria, and then the SQL parn for input into DSNTIAUL remains constant, so you don't even have to write a program to create a parm card based on the contents of F1.

Cheers
Steve
User avatar
swd
 
Posts: 109
Joined: Wed Feb 18, 2009 9:18 pm
Location: UK
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post