Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to initialize a PL/1 preprocessor variable thru JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
ashokakash

New User


Joined: 15 Nov 2006
Posts: 18
Location: Chennai

PostPosted: Thu Jun 09, 2011 3:04 pm    Post subject: How to initialize a PL/1 preprocessor variable thru JCL
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 09, 2011 3:12 pm    Post subject:
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: 18
Location: Chennai

PostPosted: Thu Jun 09, 2011 5:29 pm    Post subject:
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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Thu Jun 09, 2011 6:09 pm    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Jun 09, 2011 6:15 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us