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

How to initialize a PL/1 preprocessor variable thru JCL


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ashokakash

New User


Joined: 15 Nov 2006
Posts: 21
Location: Chennai

PostPosted: Thu Jun 09, 2011 3:04 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jun 09, 2011 3:12 pm
Reply with quote

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
View user's profile Send private message
ashokakash

New User


Joined: 15 Nov 2006
Posts: 21
Location: Chennai

PostPosted: Thu Jun 09, 2011 5:29 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jun 09, 2011 6:09 pm
Reply with quote

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
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Jun 09, 2011 6:15 pm
Reply with quote

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
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 -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts XL C Trace Preprocessor Output All Other Mainframe Topics 3
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top