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 Extracting DDL for all list of intere... Ashishpanpaliya DB2 5 Mon May 21, 2018 4:08 pm
No new posts Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am
No new posts Need inputs on DB2 tablespace/table r... ashek15 DB2 3 Sat Mar 24, 2018 11:49 pm
No new posts COBOL declaration for table Poha Eater DB2 3 Mon Feb 26, 2018 6:58 pm
No new posts load and delete table through JCL wit... ram_vizag JCL & VSAM 9 Thu Feb 01, 2018 12:47 am

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