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
 
Unload data from a table to a file : JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
chhabraravneet

New User


Joined: 04 Oct 2007
Posts: 49
Location: Mumbai

PostPosted: Tue Mar 11, 2008 12:45 pm    Post subject: Unload data from a table to a file : JCL
Reply with quote

I want to unload some data from a table into a file.
Lets say a table has some 100000 records and i want to unload from
some 10000th record. Is there any JCL for this.....
There is any option in DB2 to take extract...but if there are many records in the table we cannot take extract from the option FILE-AID , 3.7.

I want the JCL for this unload.


Thanks for ur suggestions and valuable time.
Ravneet
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Mar 11, 2008 1:07 pm    Post subject:
Reply with quote

Hi,

If BMC utility is not installed at Your site, You can use IKJEFT01 for this purpose. Search the forum for 'IKJEFT01'.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue Mar 11, 2008 2:05 pm    Post subject:
Reply with quote

you can use dsnutil if you are on vsn 6 or lower. You can use dnsuproc (load & unload) if you have vsn 7 or above. Here is unload:
Code:

//UNLOAD   EXEC DSNUPROC,
//             UID='STLETTER',UTPROC='',SYSTEM='VD0G'
//SYSREC   DD  DSN=ASTEX79.STLETTER.SYSREC,
//             DISP=(NEW,CATLG,CATLG),
//             UNIT=SYSDA,SPACE=(TRK,(2,1))
//SYSPUNCH DD  DSN=ASTEX79.STLETTER.SYSPUNCH,
//             DISP=(NEW,CATLG,CATLG),
//             UNIT=SYSDA,SPACE=(TRK,(1,1))
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DSN=ASTEX79.UNLOAD.SQL(STLETTER),
//             DISP=SHR


the parm system is for your db2 dsn.
uid is for the report. _ can be anything
sysrec contains the db2 data
syspunch contains the generated load parm after you have performed an unload. modifiy this to load a different table
sysin contains the 'WHEN' clause. you will need to know the tablespace name for your table.

Code:

//LOAD     EXEC DSNUPROC,
//             UID='STLETTER',UTPROC='',SYSTEM='VD0G'
//SYSREC   DD  DSN=ASTEX79.STLETTER.SYSREC,
//             DISP=SHR
//SYSPRINT DD  SYSOUT=*
//SORTWK01 DD  DSN=&&SORTWK01,
//             UNIT=SYSDA,SPACE=(CYL,(2,1))
//SORTWK02 DD  DSN=&&SORTWK02,
//             UNIT=SYSDA,SPACE=(CYL,(2,1))
//SORTOUT  DD  DSN=&&SORTOUT,
//             UNIT=SYSDA,SPACE=(CYL,(2,1))
//SYSMAP   DD  DSN=ASTEX79.SYSUT1,DISP=(MOD,CATLG,CATLG),
//             UNIT=SYSDA,SPACE=(CYL,(2,1))
//SYSUT1   DD  DSN=&&SYSUT1,DCB=BUFNO=10,
//             UNIT=SYSDA,SPACE=(CYL,(2,1))
//SYSDISC  DD  DSN=ASTEX79.SYSDISC,DISP=(MOD,CATLG,CATLG),
//             UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSERR   DD  DSN=&&SYSERR,


the above is load jcl. The documentation for this is contained in the Utility Guide and Reference, SC26-9945-01.
Back to top
View user's profile Send private message
chhabraravneet

New User


Joined: 04 Oct 2007
Posts: 49
Location: Mumbai

PostPosted: Tue Mar 11, 2008 2:18 pm    Post subject: Reply to: Unload data from a table to a file : JCL
Reply with quote

Thanks Dick.........
Your suggestions are helpful.
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Garbage on output file Hervey Martinez SYNCSORT 1 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 1 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am

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