Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
unloading database table content

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: unloading database table content
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    Post subject:
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    Post subject: Re: unloading database table content
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    Post subject: Re: unloading database table content
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    Post subject: Re: unloading database table content
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    Post subject: Re: unloading database table content
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts PC (UTF-8) -> z/OS (EBCDIC) -> ... prino All Other Mainframe Topics 4 Fri Sep 01, 2017 1:47 am
No new posts Adding a userid to SMTP Security table Yolanda Harvey JCL & VSAM 1 Sun Aug 13, 2017 6:16 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us