Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
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
 
Sort tip - generate DSN RUN command for DB2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
jerryte

Active User


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

PostPosted: Thu Mar 08, 2012 12:36 am    Post subject: Sort tip - generate DSN RUN command for DB2
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Generate public-private key in batch ... vasanthz All Other Mainframe Topics 3 Fri Sep 15, 2017 9:20 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us