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
 
Need to copy a DB2 table to a flat file without using BMC

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

New User


Joined: 06 Oct 2005
Posts: 7

PostPosted: Fri Nov 17, 2006 1:12 am    Post subject: Need to copy a DB2 table to a flat file without using BMC
Reply with quote

Need to copy a DB2 table to a flat file. Told not to use BMC. Note: it is TABLE not tablespace that needs to be backed up.
Back to top
View user's profile Send private message

MFRASHEED

Active User


Joined: 14 Jun 2005
Posts: 186
Location: USA

PostPosted: Fri Nov 17, 2006 1:33 am    Post subject: Re: DB2 utility
Reply with quote

Can you DSNTIAUL

Code:

//STP0100  EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=(4,LT)     
//SYSREC00 DD DSN=DOWLOAD.DATASET,
//         DISP=(,CATLG,DELETE),                         
//         UNIT=SYSDA,SPACE=(CYL,(100,100),RLSE)         
//SYSPUNCH DD  DUMMY                                     
//SYSTSPRT DD  SYSOUT=*                                 
//SYSPRINT DD  SYSOUT=*                                 
//SYSUDUMP DD  SYSOUT=*                                 
//SYSTSIN  DD  *                                         
 DSN SYSTEM(DB2S)                                       
 RUN  PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARMS('SQL')     
 END                                                     
/*                                                       
//SYSIN    DD *                                         
  SELECT * FROM TABLE.NAME
    ;                                                   
/*                                     


               


You can also use PLATINUM

Code:

//STP0400  EXEC PGM=PTLDRIVM,                   
//             PARM='EP=UTLGLCTL/DB2S',         
//             REGION=32M,                       
//             COND=(0,LT)                       
//PTILIB   DD  DSN=........                     
//PTIPARM  DD  DSN=........                     
//PTIXMSG  DD  DSN=........                     
//SYSIN    DD  *                                 
  FASTUNLOAD                                     
  UNLDDN          SYSREC                         
  LOAD-CONTROL    DB2LOAD                       
  OUTPUT-FORMAT   DSNTIAUL                       
  INPUT-FORMAT    TABLE                         
  SHRLEVEL        CHANGE                         
   SELECT *                                     
   FROM TABLE.NAME                               
/*                                               
//SYSUT1   DD  SYSOUT=*                         
//SYSDISC  DD  SYSOUT=*                         
//SYSERR   DD  SYSOUT=*                         
//SYSMAP   DD  SYSOUT=*                         
//SYSREC01 DD  DSN=DOWNLOAD.DATASET,             
//             DISP=(,CATLG,DELETE),             
//             UNIT=SYSDA,SPACE=(CYL,(50,20),RLSE), 
//             VOL=,                                 
//             DCB=(MODEL.DSCB1)                     
//PTIMSG   DD  SYSOUT=*                             
//PTIIMSG  DD  SYSOUT=*                             
//ST01MSG  DD  SYSOUT=*                             
//SYSCTL01 DD  SYSOUT=*     
//SYSOUT    DD SYSOUT=*                       
Back to top
View user's profile Send private message
MFRASHEED

Active User


Joined: 14 Jun 2005
Posts: 186
Location: USA

PostPosted: Fri Nov 17, 2006 2:29 am    Post subject: Re: DB2 utility
Reply with quote

Also review manual for details

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/dsnugj10/2.30?ACTION=MATCHES&REQUEST=UNLOAD&TYPE=FUZZY&SHELF=&DT=20040209165609&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT
Back to top
View user's profile Send private message
anita_lao

New User


Joined: 06 Oct 2005
Posts: 7

PostPosted: Fri Nov 17, 2006 2:34 am    Post subject: Re: DB2 utility
Reply with quote

Got the following error message when I used
SELECT * FROM db2 table

DSNT502I ERROR IN DSNTIAUL SQL INPUT:
DSNT408I SQLCODE = -104, ERROR: ILLEGAL SYMBOL "*". SOME SYMBOLS THAT MIGHT BE
DSNT418I SQLSTATE = 42601 SQLSTATE RETURN CODE
DSNT415I SQLERRP = DSNHPARS SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD = 0 0 0 -1 7 0 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD = X'00000000' X'00000000' X'00000000' X'FFFFFFFF' X'0000
INFORMATION
Back to top
View user's profile Send private message
anita_lao

New User


Joined: 06 Oct 2005
Posts: 7

PostPosted: Fri Nov 17, 2006 4:20 am    Post subject: Re: DB2 utility
Reply with quote

Thank you. DSNUPROC worked.
Back to top
View user's profile Send private message
MFRASHEED

Active User


Joined: 14 Jun 2005
Posts: 186
Location: USA

PostPosted: Fri Nov 17, 2006 4:49 am    Post subject: Re: DB2 utility
Reply with quote

Quote:

Got the following error message when I used
SELECT * FROM db2 table

DSNT502I ERROR IN DSNTIAUL SQL INPUT:
DSNT408I SQLCODE = -104, ERROR: ILLEGAL SYMBOL "*". SOME SYMBOLS THAT MIGHT BE


You might have missed semi-colon , this should also work if you want to try adding ';' at the end.
Back to top
View user's profile Send private message
anita_lao

New User


Joined: 06 Oct 2005
Posts: 7

PostPosted: Fri Nov 17, 2006 5:55 am    Post subject: Re: DB2 utility
Reply with quote

Tried the ';' but got the error message

DSNE117E NOT ABLE TO LOCATE DSNTIAUL IN DSNAME SYS1.LINKLIB
Back to top
View user's profile Send private message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 309
Location: Vizag / US

PostPosted: Fri Nov 17, 2006 7:42 pm    Post subject: Re: Need to copy a DB2 table to a flat file without using BM
Reply with quote

i think u need to use the correct link libraries or there is a chance like, that particular dsn utility is there in ur shop....
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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 0 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
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm

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