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
 

 

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 Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am
No new posts PA02 - Programmtically control attent... dodithegreat IMS DB/DC 1 Thu Apr 06, 2017 8:33 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am


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