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 Profile Log in to check your private messages Log in
 
Join Keys and DB2 Query

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

New User


Joined: 27 Aug 2008
Posts: 32
Location: Brazil

PostPosted: Sat Feb 13, 2016 5:57 am    Post subject: Join Keys and DB2 Query
Reply with quote

Hi,
Can I run a DB2 query and a "JOIN UNPAIRED" in the same Sort Step? Could show me an JCL example ?
Thanks a lot!
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Sat Feb 13, 2016 12:39 pm    Post subject: Reply to: Join Keys and DB2 Query
Reply with quote

Since you have SyncSORT, why don't you just try it?
Back to top
View user's profile Send private message
jackare

New User


Joined: 27 Aug 2008
Posts: 32
Location: Brazil

PostPosted: Mon Feb 15, 2016 7:20 am    Post subject: Re: Reply to: Join Keys and DB2 Query
Reply with quote

Bill Woodger wrote:
Since you have SyncSORT, why don't you just try it?


Bill,

In a single step using a DB2 query would be like this

Code:

//SORTSQL  EXEC PGM=SYNCSORT,PARM='DB2=DSN'                 
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,20)                     
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,20)                     
//SORTDBIN DD *
  SELECT COD_PRODUCT, NAME_PRODUCT
  FROM DB2LST.PRODUCT
  WHERE STATUS = 'P';
/*                                             
//SORTIN   DD DUMMY                                         
//SORTOUT  DD DSN=<output dataset name>,                       
//         DISP=(,CATLG,DELETE),                     
//         LRECL=80,RECFM=FB,BLKSIZE=0,           
//         SPACE=(CYL,(500,50),RLSE),MGMTCLAS=WORKM     
//SYSOUT   DD SYSOUT=*                                     
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                           
/*



So how to code in the same step the "SORTJNF1" with the result of the DB2 query and "SORTJNF2" with another sequential file previously generated in another JOB ?
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm

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