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
 
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: 8165
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: 998
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 Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm

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