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
 

 

Symbolic parameters in IF statements

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kris_chennai

New User


Joined: 19 Dec 2005
Posts: 7
Location: Chennai

PostPosted: Tue Dec 20, 2005 7:01 pm    Post subject: Symbolic parameters in IF statements
Reply with quote

Hi,

I need a small help. The problem is

whenever the Symbolic parameter value is 'R' execute one segment of JCL else execute another segment of JCL

Ex:

// SET CHANNEL='R' can be L some times
//*
// IF &CHANNEL='R' THEN
// do..... process1
//.........
// ELSE
// do .... process2
//..............
// ENDIF.


But while doing JSCAN I am getting an error I believe that we can't do it in this way. Could you suggest me to do this?
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4649
Location: Raleigh, NC, USA

PostPosted: Tue Dec 20, 2005 7:27 pm    Post subject: Re: Symbolic parameters in IF statements
Reply with quote

You need a program that accepts a parameter for the value of &CHANNEL and sets a Return-Code value appropriate for the value.

Here is an example:

Code:

       IDENTIFICATION DIVISION.                                 
       PROGRAM-ID. MYPROG.                                       
                                                                 
       ENVIRONMENT DIVISION.                                     
       INPUT-OUTPUT SECTION.                                     
                                                                 
       DATA DIVISION.                                           
       FILE SECTION.                                             
                                                                 
       WORKING-STORAGE SECTION.                                 
                                                                 
       LINKAGE SECTION.                                         
       01  PARM.                                                 
           03  PARM-LENGTH             PIC S9(04) COMP SYNC.     
           03  THE-PARM.                                         
               05  CHANNEL             PIC X(01).               
                                                                 
       PROCEDURE DIVISION USING PARM.                           
           DISPLAY THE-PARM.                                     
           IF CHANNEL = 'R' THEN MOVE 1 TO RETURN-CODE           
           ELSE IF CHANNEL = 'L' THEN MOVE 2 TO RETURN-CODE     
           ELSE MOVE 4 TO RETURN-CODE.   
           STOP RUN.                     


and the JCL:

Code:

//*                                             
// SET CHANNEL='L'                               
//*                                             
//STEP1    EXEC PGM=MYPROG,PARM='&CHANNEL'       
//STEPLIB  DD   DISP=SHR,DSN=...                 
//SYSOUT   DD   SYSOUT=*                         
//*                                             
// IF (STEP0001.RC = 1) THEN                     
//STEP2A   EXEC PGM=PROCESS1                     
// ENDIF                                         
// IF (STEP0001.RC = 2) THEN                     
//STEP2B   EXEC PGM=PROCESS2                     
// ENDIF                                         
//*                                             
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Tue Dec 20, 2005 7:33 pm    Post subject: Symbolic parameter
Reply with quote

Hi kris,

// SET CHANNEL='R'

Use
//SET1 SET CHANNEL='R'

Else use in this way
Code:

// SET LOC='O''''HARE'
//S1 EXEC PGM=IEFBR14,PARM='&LOC'


if error let me know what is the error.. it shows
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Paasing symbolic parameter to instrea... Anirudh Anand JCL & VSAM 1 Thu Jul 27, 2017 1:22 pm
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm
No new posts CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 pm
No new posts Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm
No new posts Multiple parameters Csongor All Other Mainframe Topics 16 Thu Jun 09, 2016 7:54 pm


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