Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts IMS Database backup info ashek15 IMS DB/DC 14 Wed Nov 16, 2016 5:29 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us