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

Sort tip - generate DSN RUN command for DB2


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jerryte

Active User


Joined: 29 Oct 2010
Posts: 202
Location: Toronto, ON, Canada

PostPosted: Thu Mar 08, 2012 12:36 am
Reply with quote

The below DFSORT jcl can be used to dynamically generate a DSN RUN command to run an application program for db2. This makes it easy to code the DB2 subsystem name as a JCL symbolic and then run a program in the subsystem.
Code:

//*                                                     
// SET DB2SYS='????'                                   
//*                                                     
//* THIS WILL GENERATE THE DSN RUN PARM USING SYMBOLICS
//* PASSED IN AS PARMS.                                 
//* JP1=DB2 SUBSYSTEM, JP2=PROGRAM, JP3=PLAN           
//*                                                     
//SORT01   EXEC PGM=SORT,                               
//  PARM='JP1"&DB2SYS",JP2"??",JP3"??"'     
//SYSOUT    DD SYSOUT=*                                 
//*SYMNOUT   DD SYSOUT=*
//SYSIN     DD *                                       
 SORT FIELDS=COPY                                       
 OUTFIL FILES=OUT,REMOVECC,                             
   HEADER1=(' DSN SYSTEM(',JP1,')',/,                   
            ' RUN PROGRAM(',JP2,') PLAN(',JP3,')')     
//SORTIN    DD *                                       
 END                                                   
//SORTOUT   DD DSN=&&DSNRUN,
//  DISP=(NEW,PASS),SPACE=(TRK,(1,1))                 

If the program requires a parm then it is easy to add another symbolic JP4 to the parm and modify the sort control statement.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top