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
 

 

GIZMO DB2 extract in a JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
jruiza

New User


Joined: 31 Aug 2005
Posts: 23

PostPosted: Thu Sep 15, 2005 9:29 pm    Post subject: GIZMO DB2 extract in a JCL
Reply with quote

I am using a GIZMO proc to extract data from Db2 tables in a JCL. I would like to include SQL query in a SYSIN.
Please, any help.
Code:

//*********************************************************************
//*
//STEP010   EXEC  DB2BATCH,
//           TIME=30,
//           REGION=4000K,
//           SYSTEM=DBA1
//SYSTSIN    DD  *
         DSN SYSTEM(DBA1)
         RUN PROGRAM(MRPDSQL) -
         PLAN(MRPDSQL) -
         LIBRARY('SYPDB2.LINKLIB')
         END
/*
//***************************************************************
//* SELECTION CRITERIA                                          *
//***************************************************************
//*
//SQLIN      DD *
[b]FORMAT=EXTERNAL
  SELECT B.CVDB_CLNT_CD,
  B.VEND_CD,
  C.ENTPR_CD,
  C.VEND_LINE_1_NM,
  C.VEND_LINE_2_NM,
  A.CNTC_NM,
  A.ALTER_DATE,
  B.LOG_ACTN_CD
  FROM CV.CV2VEND A,CV.CV2CLNT B,CV.CV2VADDR C
  WHERE B.CVDB_CLNT_CD = 'BCF'
    AND A.VEND_CD = B.VEND_CD
    AND A.ALTER_DATE = C.ALTER_DATE
  ORDER BY A.VEND_CD[/b]//*
//DATAOUT    DD  DSN=XDDB.$GDGCD.CVDB.ARIBA.EXTRACT(+1),
//            DISP=(NEW,CATLG,DELETE),
//             AVGREC=K,LRECL=500,RECFM=FB,DSORG=PS,
//             SPACE=(500,(10,100),RLSE)
//*
//DATAMAP    DD  SYSOUT=*
//*
Back to top
View user's profile Send private message

jruiza

New User


Joined: 31 Aug 2005
Posts: 23

PostPosted: Thu Sep 15, 2005 9:31 pm    Post subject:
Reply with quote

I tried this. It does not work

//SQLIN DD Dsn= datasetname,disp=shr

datasetname..
//
FORMAT=EXTERNAL
SELECT B.CVDB_CLNT_CD,
B.VEND_CD,
C.ENTPR_CD,
C.VEND_LINE_1_NM,
C.VEND_LINE_2_NM,
A.CNTC_NM,
A.ALTER_DATE,
B.LOG_ACTN_CD
FROM CV.CV2VEND A,CV.CV2CLNT B,CV.CV2VADDR C
WHERE B.CVDB_CLNT_CD = 'BCF'
AND A.VEND_CD = B.VEND_CD
AND A.ALTER_DATE = C.ALTER_DATE
ORDER BY A.VEND_CD
//*
Back to top
View user's profile Send private message
Anbudan

New User


Joined: 07 Sep 2005
Posts: 26
Location: Germany

PostPosted: Thu Sep 22, 2005 2:27 pm    Post subject:
Reply with quote

Hi jruiza

If Ur question is to Unload from the DB2 table, then see below:
This will retreive records from the DB2 table and put it into ur output file.


Here is the easy way:

//UNLOAD EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM()
RUN PROGRAM(DSNTIAUL) PARM('SQL')
//SYSUDUMP DD SYSOUT=*
//SYSPUNCH DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSREC00 DD DSN=JRUIZA.TEST.OUTFILE,
// UNIT=SYSDA,SPACE=(CYL,(10,10),RLSE),
// DCB=(BLKSIZE=0,LRECL=10,RECFM=FB),
// DISP=(NEW,CATLG,DELETE)
//SYSIN DD *
SELECT "NAME"
, SUBSTR(' ',1,1)
FROM X
WITH UR
;
//*


If you have any doubt,

Contact me



Anbudan
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 What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Sort Logic to extract data scorp_rahul23 DFSORT/ICETOOL 13 Tue Mar 01, 2016 1:22 am
No new posts how to extract the member name ? jackzhang75 CLIST & REXX 2 Wed Feb 17, 2016 9:21 pm


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