IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Join Keys and DB2 Query


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jackare

New User


Joined: 27 Aug 2008
Posts: 35
Location: Brazil

PostPosted: Sat Feb 13, 2016 5:57 am
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Feb 13, 2016 12:39 pm
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: 35
Location: Brazil

PostPosted: Mon Feb 15, 2016 7:20 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Use input file with OMIT rcd keys? DFSORT/ICETOOL 15
Search our Forums:

Back to Top