View previous topic :: View next topic
|
Author |
Message |
ashokakash
New User
Joined: 15 Nov 2006 Posts: 21 Location: Chennai
|
|
|
|
Hi,
I have a Macro variable XYZ. I want to initialize this variable during compilation.
In C, I could do this for a variable SMEM with the below statements
//CCOMP EXEC PROC=WCCOMP,
// DEFINE='DEF(SMEM)',
How can we achieve this for PL/1?
Many thanks in advance. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
First question as always is, what have you researched for yourself before posting.
Where have you looked, what did you find that is unclear |
|
Back to top |
|
|
ashokakash
New User
Joined: 15 Nov 2006 Posts: 21 Location: Chennai
|
|
|
|
Hello EXPAT,
A part of my C code is below
#ifdef SMEM
#include <signal.h>
#define SAFEALLOC(s) safemalloc(
void leave(int sig);
#else
#define SAFEALLOC(s) malloc(s)
#endif
To set SMEM true, I have used the below DEFINE parameter in the compiler. If the below DEFINE parameter is not used, always SMEM is false.
//CCOMP EXEC PROC=WCCOMP,
// DEFINE='DEF(SMEM)',
Similarly, I have a preprocessor variable #PLIATEST in PL/1 that is given below.
%IF #PLIATEST='YES' %THEN %DO;
PUT SKIP LIST ('--------------');
%END;
I want to set the variable #PLIATEST to YES or NO thru compiler JCL. Is there a way to do that? If not charater, can we set a boolean value? Do we have any other similar way to initialize during compilation?
I hope, I made my question clear. Please let me know if you still did not understand. Many thanks. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
I think your first mistake is obvious: PL/I is not C. You cannot expect something that works in one language to be exactly replicated in another language -- so what you want to do may, or may not, even be possible.
Your second mistake is also obvious: you were asked what reading of the PL/I Langauge Reference and Programming Guide manuals you have done already. You ignored this question. Since these manuals are available at the IBM web site as well as through the manuals link at the top of this page, there really is no excuse for you to not have answered the question. This is a HELP forum, not a READ-THE-MANUAL-FOR-YOU forum. The type of question you asked is typically answered, very thoroughly, by IBM in their language manuals. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Quote: |
Your second mistake is also obvious: you were asked what reading of the PL/I Langauge Reference and Programming Guide manuals you have done already. You ignored this question. |
I agree that you should read the PL/I Langauge Reference and Programming Guides - with particular attention to the SYSPARM compiler option.
I've managed to use this compiler option to do exactly what you want.
Garry. |
|
Back to top |
|
|
|