passing contents of Dataset as Parameter



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Re: passing contents of Dataset as Parameter

Postby rajas.abcdefg » Mon Jul 27, 2009 12:41 am

The sort card used to generate date is as follows :

//STEP1 EXEC PGM=ICEMAN
//SORTIN DD *
EMPTY record
/*
//SORTOUT DD DSN=DEVELOP.EMPLYO.DUMMY,
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=0),
// SPACE=(CYL,(1,1),RLSE),
// DISP=(NEW,CATLG,DELETE)
//SYSIN DD *
OPTION COPY
INREC BUILD=(1:DATE1-1)
OUTFIL BUILD=(5,2,7,2,3,2,80:X)
/*
the output of step1 will be
********************************* Top of Data **********************************
072509
******************************** Bottom of Data ********************************

//STEP2 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=PROD.EMPLYO.FILE,DISP=SHR

//SYSUT2 DD DSN=DEVELOP.EMPLYO.FILE.Z&d ,DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(3,4),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
/*
and the value of &d should be yesterdays date in the format of 072509
rajas.abcdefg
 
Posts: 38
Joined: Thu Jul 09, 2009 8:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Re: passing contents of Dataset as Parameter

 

Re: passing contents of Dataset as Parameter

Postby rajas.abcdefg » Mon Jul 27, 2009 12:42 am

Do let me know if you need further information.
rajas.abcdefg
 
Posts: 38
Joined: Thu Jul 09, 2009 8:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: passing contents of Dataset as Parameter

Postby rajas.abcdefg » Mon Jul 27, 2009 12:44 am

Please do suggest me the alternative way if any to get the value &d = 072509
rajas.abcdefg
 
Posts: 38
Joined: Thu Jul 09, 2009 8:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: passing contents of Dataset as Parameter

Postby MrSpock » Mon Jul 27, 2009 3:01 pm

My response:

//STEP0001 EXEC PGM=ICEMAN
//SORTIN   DD   *
DUMMY
/*
//SORTOUT  DD   DSN=&&T1,DISP=(,PASS),UNIT=VIO,SPACE=(TRK,(1,1),RLSE)
//SYSOUT   DD   SYSOUT=*
//SYSIN    DD   *
  OPTION COPY                 
  INREC BUILD=(1:DATE1-1,80:X)
  OUTFIL REMOVECC,NODETAIL,
    TRAILER1=(C'  ALTER ',C'''',C'PROD.EMPLYO.FILE.WORK',C'''',
      C' -',/,
      C'    NEWNAME(',C'''',C'DEVELOP.EMPLYO.FILE.Z',5,2,7,2,3,2,
      C'''',C')')
/*
//*
//STEP0002 EXEC PGM=ICEGENER
//SYSUT1 DD DSN=PROD.EMPLYO.FILE,DISP=SHR
//SYSUT2 DD DSN=PROD.EMPLYO.FILE.WORK,
// UNIT=SYSDA,SPACE=(TRK,(3,4),RLSE),
// DISP=(,CATLG,DELETE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//*
//STEP0003 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SORTOUT  DD   DSN=&&T1,DISP=(OLD,DELETE),UNIT=VIO
//*
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: passing contents of Dataset as Parameter

Postby MrSpock » Tue Jul 28, 2009 12:09 am

Or:

First Job:
//STEP0001 EXEC PGM=ICEMAN                                 
//SORTIN   DD   *                                         
DUMMY                                                     
/*                                                         
//SORTOUT  DD   DSN=PROD.PARMLIB(ZDATE),DISP=SHR           
//SYSOUT   DD   SYSOUT=*                                   
//SYSIN    DD   *                                         
  OPTION COPY                                             
  INREC BUILD=(1:DATE1-1,80:X)                             
  OUTFIL REMOVECC,NODETAIL,                               
    TRAILER1=(C'// SET D=Z',5,2,7,2,3,2)                   
/*                                                         
//*           


Second Job:

//*                                               
// JCLLIB ORDER=(PROD.PARMLIB)                     
// INCLUDE MEMBER=ZDATE                           
//*                                               
//STEP0001 EXEC PGM=ICEGENER                       
//SYSUT1   DD   DSN=PROD.EMPLYO.FILE,DISP=SHR 
//SYSUT2   DD   DSN=DEVELOP.EMPLYO.FILE.&D,       
// UNIT=SYSDA,SPACE=(TRK,(3,4),RLSE),             
// DISP=(,CATLG,DELETE)                           
//SYSPRINT DD   SYSOUT=*                           
//SYSIN    DD   DUMMY                             
//*                                               
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: passing contents of Dataset as Parameter

Postby expat » Tue Jul 28, 2009 11:36 am

Have you considered using REXX and ISPF file tailoring to do this.
expat
 
Posts: 382
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 1 time

Re: passing contents of Dataset as Parameter

Postby rajas.abcdefg » Mon Aug 03, 2009 8:05 pm

Thanks a lot Mr Spock. I am able to take the back ups using JCL.

Thanks a ton.
rajas.abcdefg
 
Posts: 38
Joined: Thu Jul 09, 2009 8:56 pm
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post