Hello List,

This post is related to the existing discussion but does not address the C 
fopen() issue.

I have, on occasion, needed a static system symbol in batch JCL that could not 
be easily incorporated into a "symbolicrelate" alias. To that end, I wrote a 
small NetView REXX that is executed shortly after IPL and after IEASYMUP is 
used to modify a static system symbol. I thought I'd share it for those 
interested parties who have NetView.


/* Always practice safe REXX                                        */ 
/********************************************************************/ 
/*                                                                  */ 
/* ***** Description *****                                          */ 
/*                                                                  */ 
/* Create a member of SYS2.PROCLIB that sets JCL symbols to the     */ 
/* value of their corresponding MVS static system symbol. It may    */ 
/* be INCLUDEd into batch jobs, allowing them access to the MVS     */ 
/* symbol definitions:                                              */ 
/*                                                                  */ 
/* //  INCLUDE MEMBER=MVSVARS                                       */ 
/*                                                                  */ 
/*------------------------------------------------------------------*/ 
/*                                                                  */ 
/* Activity log:                                                    */ 
/*                                                                  */ 
/* 08/11/08 ALS Initial incarnation                                 */ 
/*                                                                  */ 
/********************************************************************/ 
                                                                       
  Parse Source where what myname ddname junk                           
  my_rc = 0                                                            
                                                                       
  cc1 = '//'copies('*',68)                                             
  cc2 = '//*   'date('U')'  'time('N')                                 
  cc3 = '//*'                                                          
  cc4 = '//* The following set statements define JCL symbolics which'  
  cc5 = '//* correspond to the values of all MVS static system symbols'
  cc6 = '//*'                                                          
  cc7 = '//'copies('*',68)                                             
                                                                       
  "Pipe (Name getvars End ¬) " ,                                        
  "| MVS D SYMBOLS " ,                
  "| CORRWAIT  10 " ,                 
  "| SEPARATE  " ,                    
  "| DROP FIRST 1 LINES " ,           
  "| CHANGE / // " ,                  
  "| CHANGE /""/'/ " ,                
  "| CHANGE '&'//  SET ' " ,          
  "| CHANGE /.// " ,                  
  "| LITERAL '"cc7"' " ,              
  "| LITERAL '"cc6"' " ,              
  "| LITERAL '"cc5"' " ,              
  "| LITERAL '"cc4"' " ,              
  "| LITERAL '"cc3"' " ,              
  "| LITERAL '"cc2"' " ,              
  "| LITERAL '"cc1"' " ,              
  "| QSAM (DSN) SYS2.PROCLIB(MVSVARS)"


Member MVSVARS in SYS2.PROCLIB (which is in the standard JES concatenation) 
looks like this:

//******************************************************************** 
//*   09/05/10  21:57:51                                               
//*                                                                    
//* THE FOLLOWING SET STATEMENTS DEFINE JCL SYMBOLICS WHICH            
//* CORRESPOND TO THE VALUES OF ALL MVS STATIC SYSTEM SYMBOLS          
//*                                                                    
//******************************************************************** 
//  SET SYSALVL='2'                                                    
//  SET SYSCLONE='Y1'                                                  
//  SET SYSNAME='SY1'                                                  
//  SET SYSPLEX='WAWPLEX'                                              
//  SET SYSR1='RES2E1'                                                 
//  SET CNMDOMN='CNM10'                                                
//  SET CNMHLQ#='3'                                                    
//  SET CNMNETID='PERS'                                                
//  SET CNMRODM='EKGRODM'                                              
//  SET CNMSA='10'                                                     
//  SET CNMTCPN='TCPIP'                                                
//  SET DASDSTAT='LIST'                                                
//  SET ID='2'                                                         
//  SET LPAR='PA2'                                                     
//  SET MODOCE1='FSS666A'                                              
//  SET MQ1EJES='4'                                                    
//  SET MQ1OMXE='3'                                                    
//  SET MRTOMXE='#1'                                                   
//  SET MVRDLVR='R1100A'                                               
//  SET MVREJES='V4R5M0'                                               
//  SET MVRJARS='R1200A'                                               
//  SET MVROCEP='V040200A'                                             
//  SET MVROMXE='V040100A'                                             
//  SET MVRQRDB='R0701A'                                               
//  SET MVRQRDS='R0701A'                                               
//  SET MVRVIEW='R1100A'                                               
//  SET MVSDSNQ='Z19'                                                  
//  SET MVSVRL='19'                                                    
//  SET NETEVENT='EXECUTE'                                             
//  SET SYSL1='SYS2L1'                                                 
//  SET SYSL2='SYS2L2'  


Batch JCL that utilizes these symbols must specify: // INCLUDE MEMBER=MVSVARS


It's not pretty but it can be helpful to circumvent that annoying restriction.

Cheers,
Alan                                               



 

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of 
Mark Zelden
Sent: Wednesday, February 23, 2011 11:22
To: [email protected]
Subject: Re: System symbols in dynamic allocation

On Wed, 23 Feb 2011 08:43:31 -0800, Charles Mills <[email protected]> wrote:

>Thanks. I have no interest in "improving" JCL. I want to be able to use 
>a single common control file to specify the name of a file for an STC 
>that could be unique across systems:
>
>MYFILE=MY.&SYSNAME..DATA.FILE
>
>MY.&SYSNAME..DATA.FILE would ultimately end up in an fopen():
>
>fopen("MY.&SYSNAME..DATA.FILE", ...);  // would actually be a chr* variable
>not a literal
>

You could use the symbol service in a assembler program to figure it out 
yourself and pass that along to your fopen.

--
Mark Zelden - Zelden Consulting Services - z/OS, OS/390 and MVS       
mailto:[email protected]                                          
Mark's MVS Utilities: http://home.flash.net/~mzelden/mvsutil.html
Systems Programming expert at http://expertanswercenter.techtarget.com/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
[email protected] with the message: GET IBM-MAIN INFO Search the archives at 
http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to