Page 1 of 1

Table Unload Help!

PostPosted: Tue Apr 21, 2009 12:37 pm
by gokulNmf
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

Re: Table Unload Help!

PostPosted: Tue Apr 21, 2009 3:57 pm
by MrSpock
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.

Re: Table Unload Help!

PostPosted: Tue Apr 21, 2009 6:24 pm
by swd
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

Re: Table Unload Help!

PostPosted: Tue Apr 21, 2009 6:35 pm
by swd
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