Unload table structure to dataset



IBM's flagship relational database management system

Unload table structure to dataset

Postby jferrerm » Mon May 02, 2016 4:24 pm

Hello,

I need to obtain the structure dataset. Currently we areusing this JCL:

//UXDUMMY JOB ,,NOTIFY=&SYSUID,MSGCLASS=H,CLASS=A                  
//PASO10 EXEC DSNUPROC                                              
//SYSIN DD *                                                        
  UNLOAD TABLESPACE xxxxxxxx.yyyyyyyyy FROM TABLE ZZZZZ.YYYYY        
  SHRLEVEL REFERENCE;                                              
/*                                                                  
//SYSREC   DD DUMMY                                                
//SYSPUNCH DD DSN=SISTEMAS.DB1TLX(YYYYY),DISP=SHR
 

This is a good way to obtain this, but if the tables has a large cardinality, this job takes a long time because unload all the data.

Anybody knows the way to obtain the structure whithout unload the data?

Thanks
jferrerm
 
Posts: 2
Joined: Mon May 02, 2016 4:16 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Unload table structure to dataset

 

Re: Unload table structure to dataset

Postby jferrerm » Mon May 02, 2016 4:28 pm

We need to obtain a dataset like this:

LOAD DATA INDDN SYSREC   LOG NO  REPLACE NOCOPYPEND ENFORCE NO
 EBCDIC  CCSID(01145,00000,00000)                              
 INTO TABLE "xxxxx"."yyyyy"                                  
 ( "CCVDOC"                                                    
        POSITION(  00003:00042) CHAR(00040)                    
 , "FECHACRE"                                                  
        POSITION(  00043:00068) TIMESTAMP EXTERNAL            
 , "CTIPMOV"                                                  
        POSITION(  00069:00070) SMALLINT                      
 , "CLAVE"                                                    
        POSITION(  00071:00110) CHAR(00040)                    
 , "CIDEN"                                                    
        POSITION(  00111:00125) CHAR(00015)                    
 , "CCAMBIO"                                                  
        POSITION(  00126:00127) SMALLINT                      
 , "XTEXTO"                                                    
        POSITION(  00128:00629) VARCHAR                        
 )
jferrerm
 
Posts: 2
Joined: Mon May 02, 2016 4:16 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Unload table structure to dataset

Postby NicC » Mon May 02, 2016 4:47 pm

Please use the code tags when posting data, jcl, control cards, screen "shots" - anything requiring a fixed pitch font. Plenty of examples around of how to do this.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2634
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 95 times

Re: Unload table structure to dataset

Postby ayesomeone » Fri May 06, 2016 2:07 pm

how about try the control statement using:
select * from table fetch first 1 rows only;
to unload the data, but I can't recall the program's name...
ayesomeone
 
Posts: 1
Joined: Fri May 06, 2016 1:26 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Unload table structure to dataset

Postby Raja190 » Sun May 08, 2016 5:47 pm

@ayesomeone, I guess the same utility used in above thread would work (DSNUPROC).

He just need to give the below query and could get the structure easily.


Select * from table-name
fetch 1 rows only;
Raja190
 
Posts: 35
Joined: Mon Dec 14, 2015 8:13 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post