View previous topic :: View next topic
|
Author |
Message |
hallecodec
New User
Joined: 05 Sep 2006 Posts: 30 Location: Philippines
|
|
|
|
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 |
|
|
bbharathiraj Warnings : 1 New User
Joined: 26 Oct 2006 Posts: 50 Location: Chennai
|
|
|
|
Yes. You can use. But I have no idea what utility you are using to unload this table |
|
Back to top |
|
|
Rajen
New User
Joined: 05 May 2005 Posts: 61
|
|
|
|
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 |
|
|
hallecodec
New User
Joined: 05 Sep 2006 Posts: 30 Location: Philippines
|
|
|
|
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 |
|
|
Rajen
New User
Joined: 05 May 2005 Posts: 61
|
|
|
|
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 |
|
|
hallecodec
New User
Joined: 05 Sep 2006 Posts: 30 Location: Philippines
|
|
|
|
Hi Rajen,
Between the two methods, which will run faster, suppose i have 2million+ records to process?
Thanks a lot,
Hallecodec |
|
Back to top |
|
|
|