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

unloading database table content


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
hallecodec

New User


Joined: 05 Sep 2006
Posts: 30
Location: Philippines

PostPosted: Tue Dec 12, 2006 8:18 am
Reply with quote

hi guys,

Please see this piece of jcl statement:

//SYSIN DD *
UNLOAD SHRLEVEL REFERENCE
...
SELECT * FROM DALP3.PEDT001
/*

This JCL statement unloads all the the contents of the table DALP3.PEDT001.

Can I insert a more complex SQL statement like:

//SYSIN DD *
UNLOAD SHRLEVEL REFERENCE
...
SELECT PE01.PE01_CUST_NO,
PE01.PE01_CUST_NM,
PE01.PE01_HOME_ADR,
PE01.PE01_CORR_ADR,
PE01.PE01_CHANL_ADR,
BG041.BG041_ACT_NO,
BG041.BG041_ACT_STAT,
BG041.BG041_CUR_BAL
FROM PEDT001 AS PE01,
BGDT041 AS BG041
WHERE PE01.PE01_CUST_NO = BG041.BG041_CUST_NO
/*
Back to top
View user's profile Send private message
bbharathiraj
Warnings : 1

New User


Joined: 26 Oct 2006
Posts: 50
Location: Chennai

PostPosted: Tue Dec 12, 2006 8:54 am
Reply with quote

Yes. You can use. But I have no idea what utility you are using to unload this table
Back to top
View user's profile Send private message
Rajen

New User


Joined: 05 May 2005
Posts: 61

PostPosted: Tue Dec 12, 2006 9:53 am
Reply with quote

Hi Hallecodec,
If I am not mistaken you are using Platinum to unload table.
Yes you can use the complex query to fetch data from table but make sure your output file have required LRECL defined for resultant record.

As you fetching data from 2 table you have to be very careful about the output dataset.

Thanks,
Rajen.
Back to top
View user's profile Send private message
hallecodec

New User


Joined: 05 Sep 2006
Posts: 30
Location: Philippines

PostPosted: Tue Dec 12, 2006 12:16 pm
Reply with quote

hi rajen,

Is it possible to use the resulting dataset from a query to be used in a ftp to a unix server?

and

Which do you think is better:
(a) seperately unloading the two tables, execute a cobol program to join their contents, and use the output dataset for the ftp, or
(b) creating a sql statement that joins the contents of the two tables (like the sql statement i've stated), and use the resulting dataset for the ftp?
Back to top
View user's profile Send private message
Rajen

New User


Joined: 05 May 2005
Posts: 61

PostPosted: Tue Dec 12, 2006 1:04 pm
Reply with quote

Hi Hallecodec,
Yes you can FTP the unloaded dataset to Unix Server. FTP is irelavant to data beinf transmitted.

Although i have worked little on FTP dataset i would recommend
you to unload the data from 2 table into separate datasets and then write cobol program to merge these 2 datasets and then FTP.

The advantage in doing this is you are breaking up your query in parts so that in future your requirement changes it would be easy for someone to understand.

Even doing it in a single won't cause any harm to the results and you can FTP that dataset also.


Thanks,
Rajen.
Back to top
View user's profile Send private message
hallecodec

New User


Joined: 05 Sep 2006
Posts: 30
Location: Philippines

PostPosted: Tue Dec 12, 2006 1:23 pm
Reply with quote

Hi Rajen,

Between the two methods, which will run faster, suppose i have 2million+ records to process?

Thanks a lot,
Hallecodec
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts What database does Jobtrac use CA Products 4
Search our Forums:

Back to Top