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
 

 

Creating vsam dataset and REPROing the data to output DSN.

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

Active User


Joined: 02 Jul 2005
Posts: 124
Location: Gurgaon

PostPosted: Mon Nov 21, 2005 6:14 pm    Post subject: Creating vsam dataset and REPROing the data to output DSN.
Reply with quote

In the following JCL, in STEP001, I am checking the input file, if the input file is there, then I am allocating an output file ( temporary file ); else
SET MAXXCC=0.

In STEP002, right now I am checking the data in the input file, if the data is there in the input file, then I am copying the data into output file (temp file), else SET MAXXCC =0.

But I wanted to add one more condition to this job. i.e., if the input file is not there in STEP001, then I need to bypass STEP002 or in STEP002 I need to add one more condition.( i.e., first I need to check the input file,
if there then check the data in that file, if the data was there copy into output file else SET MAXCC=0.

Code:
                                               
//**********************************************************************
//*                   ALLOCATE TEMP VSAM FILE                          *
//******************************************************************
//STEP001  EXEC PGM=IDCAMS,                                             
//         COND=(0,LT)                                                 
//SYSPRINT DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
    LISTC ENT(BAS1234.T.STAKDUMP)                                       
    IF LASTCC = 0 THEN                                                  -
    DEFINE CLUSTER                                                     -
       (NAME(BAS1234.T.STAKDUMP.TEMP)                                 -
        MODEL(BAS1234.T.STAKDUMP))                                     
   ELSE SET MAXCC = 0                                                   
/*                                                                     
//*                                                                     
//*********************************************************************
//*        COPY THE DATA FROM ORG VSAM FILE TO TEMP VSAM FILE          *
//**********************************************************************
//STEP002  EXEC PGM=IDCAMS,                                             
//         COND=(0,LT)                                                 
//SYSPRINT DD SYSOUT=*                                                 
//FILEIN   DD DSN=BAS1234.T.STAKDUMP,                                   
//            DISP=SHR                                                 
//FILEOUT  DD DSN=BAS1234.T.STAKDUMP.TEMP,                             
//            DISP=OLD                                                 
//SYSIN    DD *                                                         
        VERIFY FILE(FILEIN)                                             
        IF LASTCC = 0 THEN REPRO INFILE(FILEIN) OUTFILE(FILEOUT)         
           ELSE SET MAXCC=0                                             
/*                                                                     
//*
Back to top
View user's profile Send private message

Bharanidharan

New User


Joined: 20 Jun 2005
Posts: 86
Location: Chennai, India

PostPosted: Tue Nov 22, 2005 10:02 pm    Post subject: Re: Creating vsam dataset and REPROing the data to output DS
Reply with quote

You can set maxcc of STEP001 to any user-defined value, say 12. Then you can use IF LASTCC > 0 and ENDIF for STEP002.

Please correct me if I am wrong.
Back to top
View user's profile Send private message
Phantom

New User


Joined: 04 Sep 2005
Posts: 25

PostPosted: Wed Nov 23, 2005 12:21 pm    Post subject:
Reply with quote

crrindia,

Why do you need two steps for this. You can do everything in just one step. See below

Code:

//STEP001  EXEC PGM=IDCAMS                                           
//SYSPRINT DD   SYSOUT=*                                             
//SYSIN    DD *                                                       
 LISTC ENT(INPUT.VSAM)                                     
 IF LASTCC = 0 THEN DO                                               
   DEFINE CLUSTER (NAME(OUTPUT.VSAM) MODEL(INPUT.VSAM))
   VERIFY DATASET(INPUT.VSAM)                               
   IF LASTCC = 0 THEN                                                 
    REPRO INDATASET(INPUT.VSAM) OUTDATASET(OUTPUT.VSAM)
 END                                                                 
 ELSE SET MAXCC=0                                                     
/*                                                                   
//*                                                                   


Hope this helps,

Thanks,
Phantom
Back to top
View user's profile Send private message
crrindia

Active User


Joined: 02 Jul 2005
Posts: 124
Location: Gurgaon

PostPosted: Fri Nov 25, 2005 3:07 pm    Post subject:
Reply with quote

Hi Phantom, Thank You very mcuh. Now I'll try this.
Thanks!
Rat.
Phantom wrote:
crrindia,

Why do you need two steps for this. You can do everything in just one step. See below

Code:

//STEP001  EXEC PGM=IDCAMS                                           
//SYSPRINT DD   SYSOUT=*                                             
//SYSIN    DD *                                                       
 LISTC ENT(INPUT.VSAM)                                     
 IF LASTCC = 0 THEN DO                                               
   DEFINE CLUSTER (NAME(OUTPUT.VSAM) MODEL(INPUT.VSAM))
   VERIFY DATASET(INPUT.VSAM)                               
   IF LASTCC = 0 THEN                                                 
    REPRO INDATASET(INPUT.VSAM) OUTDATASET(OUTPUT.VSAM)
 END                                                                 
 ELSE SET MAXCC=0                                                     
/*                                                                   
//*                                                                   


Hope this helps,

Thanks,
Phantom
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 Data replication from multiple Db2 ta... kishpra DB2 1 Mon Mar 27, 2017 9:58 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm


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