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

if.. then else.. if.. conditions in the idcams utility.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
crrindia

Active User


Joined: 02 Jul 2005
Posts: 124
Location: Gurgaon

PostPosted: Tue Nov 22, 2005 12:16 pm
Reply with quote

Hi all please let me know how to put if.. then..else..if conditions in the idcams utility. here I am giving my job.

Code:

//**********************************************************************
//*        COPY THE DATA FROM ORG VSAM FILE TO TEMP VSAM FILE          *
//**********************************************************************
//STEP002  EXEC PGM=IDCAMS,                                             
//         COND=(0,LT)                                                 
//SYSPRINT DD SYSOUT=*                                                 
//FILEIN   DD DSN=BAS9365.T.STAKDUMP,                                   
//            DISP=SHR                                                 
//FILEOUT  DD DSN=BAS9365.T.STAKDUMP.TEMP,                             
//            DISP=OLD                                                 
//SYSIN    DD *                                                         
       LISTC ENT(BAS9365.T.STAKDUMP)                                     
       IF LASTCC = 0 THEN                                               -
          VERIFY FILE(FILEIN)                                           -
          ELSE IF LASTCC = 0 THEN REPRO INFILE(FILEIN) OUTFILE(FILEOUT) -
               ELSE SET MAXCC = 0                                       
/*                                                                     
//*                   


Rat.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Tue Nov 22, 2005 2:52 pm
Reply with quote

hi frnd,
In general the syntax is

//name IF [relational expression] THEN [comments]
//name ELSE [comments]
//name ENDIF [comments]

For example, to test that a return code is greater than 4, code:
// IF RC > 4 THEN
You can enclose the relational-expression in parentheses.

//TESTCON IF (RC = 8 | RC = 1) | RC = 12 |
// RC = 14) THEN COMMENTS OK HERE
.
.

For example, to test for a return code of 8, code:
//TESTA IF (RC = 8) THEN

So in ur case u r checking for the LASTCC two times. y? if so then close the endif parameter and then go ahead. hope it will work. let me know if any error is thrown.
Back to top
View user's profile Send private message
creator.abhishek

New User


Joined: 07 May 2006
Posts: 32
Location: Pune

PostPosted: Mon Jul 10, 2006 3:19 pm
Reply with quote

hi crr...
generaly if else condition used in idcams utility by the basis of last condition code or lasscc, u hav written right,

eg:
//sysin dd *
any command like repro ...................
if lastcc = 0 then other comaand......
else other command..........
end-if
/*

similerly , u r also able to give in if the else steps, like one friend shown above.
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts IBM IMU Utility for Easytrieve Code t... IBM Tools 0
No new posts Use of long filenames with GDKUTIL ut... IBM Tools 3
No new posts Partial Sort conditions for PD fields DFSORT/ICETOOL 16
No new posts Use Copy Utility DB2 7
No new posts How to load to DB2 with column level ... DB2 6
Search our Forums:


Back to Top