Page 1 of 1

DB2 database unload to a KSDS

PostPosted: Thu Nov 18, 2010 5:13 pm
by jaggz
Hi,

I have a task of Unloading a DB2 database into a KSDS dataset. Could you please share your Input to proceed with this task. Well, I Thought of Unloading the DB2 DB into a PS DSN. Then sorting out the PS with Sort utility and converting it into a KSDS dsn. To achieve this can anyone share me a Sample JCL or Tip. Apology if my thoughts are not feasible.

Re: DB2 database unload to a KSDS

PostPosted: Fri Nov 19, 2010 12:23 am
by dick scherrer
Hello,

What you have described will do what you want.

Run an unload from database.
Run a load to the vsam file.

Where are you stuck?

Keep in mind that we will help you with your effort, but we won't actually do the work.

Re: DB2 database unload to a KSDS

PostPosted: Fri Nov 19, 2010 10:47 am
by jaggz
This is the below JCL I have created to unload a DB to a PS file. whats the way to include the DB attributes.


//A255209J JOB MSGCLASS=X,MSGLEVEL=(1,1),CLASS=A,             
//         REGION=5M,NOTIFY=&SYSUID                           
//STEP1 EXEC PGM=IKJEFT1B,DYNAMNBR=20,REGION=3072K             
//STEPLIB DD DSN=DSN811.SDSNLOAD,DISP=SHR                     
//ISPPROF DD UNIT=3390,SPACE=(TRK,(9,1,4)),                   
// DCB=(LRECL=175,BLKSIZE=27825,RECFM=FB,DSORG=PO)             
//SYSUDUMP DD SYSOUT=*                                         
//SYSOUT DD SYSOUT=*                                           
//REPORT DD SYSOUT=*                                           
//SYSPRINT DD SYSOUT=*                                         
//SYSIN DD *                                                   
  DSN SYSTEM(DB2 SUBSYSTEM NAME)                               
  RUN PROGRAM(DSNTIAUL) PLAN(PLANNAME) PARMS('SQL') +         
  LIB('DSN811.RUNLIB.LOAD')                                   
//************************************************************
//SYSPRINT DD SYSOUT=*                   
//SYSPUNCH DD DUMMY                       
//SYSREC00 DD DSN=HLQ1.HLQ2.HLQ3,         
// DISP=(NEW,CATLG,KEEP),                 
// SPACE=(CYL,(200,200),RLSE),           
// UNIT=3390                             
//SYSIN DD *

Re: DB2 database unload to a KSDS

PostPosted: Fri Nov 19, 2010 10:57 am
by dick scherrer
Hello,

whats the way to include the DB attributes.
What is this asking? The unload will create a sequential file that you can use to load the vsam file (if the vsam file is defined the same way).

If thei vsam file is defined differently, you would reformat the unloaded data to be compatible with the vsam data layout.