JCL PRINT assignment help..?



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

JCL PRINT assignment help..?

Postby magik5 » Tue Feb 19, 2008 1:22 am

Hello all,

I need some help with an assignment That i have to work on.
I am trying to execute a 4 step job. I want to create a file on disk, print the records, then i must append more records to the file, and then finally print the file again with the new reocrds that I added in the previous step.

Here's my original code
//Y111 JOB SC064502,
//         CLASS=A,
//         MSGCLASS=X
//*
//*-------------------------------------------------------------------*//
//*                                                                   *//
//* CREATE STEP 1                                                     *//
//*                                                                   *//
//*-------------------------------------------------------------------*//
//*
//CREATE   EXEC PGM=IEBGENER
//SYSIN    DD DUMMY
//SYSUT2   DD DSN=MYFILE,
//            DISP=(NEW,PASS),
//            UNIT=SYSDA,
//            SPACE=(TRK,1),
//            DCB=(LRECL=80,RECFM=F,BLKSIZE=80)
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD   *
Steve Nash
Shawn Marion
Tyrus Thomas
LeBron James
Tim Duncan
/*
//*
//*-------------------------------------------------------------------*//
//*                                                                   *//
//* PRINT STEP 2                                                      *//
//*                                                                   *//
//*-------------------------------------------------------------------*//
//*
//PRINT  EXEC PGM=IEBGENER
//SYSIN  DD  DUMMY
//SYSPRINT DD  SYSOUT=*
//SYSUT2 DD  SYSOUT=*
//SYSUT1 DD  DSN=MYFILE,
//           DISP=(OLD,KEEP)
//*
//*-------------------------------------------------------------------*//
//*                                                                   *//
//* ADDMORE STEP 3                                                    *//
//*                                                                   *//
//*-------------------------------------------------------------------*//
//*
//ADDMORE  EXEC  PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN    DD  DUMMY
//SYSUT1   DD   *
David West
Yao Ming
Dwayne Wade
Jason Kidd
Richard Hamilton
/*
//SYSUT2  DD DSN=MYFILE,
//           DISP=(MOD,PASS)
//*
//*-------------------------------------------------------------------*//
//*                                                                   *//
//* PRINT2 STEP 4                                                     *//
//*                                                                   *//
//*-------------------------------------------------------------------*//
//*
//PRINT2    EXEC PGM=IEBGENER
//SYSIN    DD  DUMMY
//SYSPRINT DD  SYSOUT=*
//SYSUT2   DD  SYSOUT=*
//SYSUT1   DD  DSN=MYFILE,
//             DISP=(OLD,DELETE)
//


But then I reiceve many errors like this from when I run it..
ICH70001I Y11      LAST ACCESS AT 14:49:35 ON MONDAY, FEBRUARY 18, 2008
 ICH408I USER(Y11     ) GROUP(ACADGRP ) NAME(ACADEMIC BATCH USER )
   MYFILE CL(DATASET ) VOL(STRG01)
   DEFINE - WARNING: RESOURCE NOT PROTECTED
 ICH408I USER(Y11     ) GROUP(ACADGRP ) NAME(ACADEMIC BATCH USER )
   MYFILE CL(DATASET ) VOL(STRG03)
   DEFINE - WARNING: RESOURCE NOT PROTECTED
 ICH408I USER(Y11     ) GROUP(ACADGRP ) NAME(ACADEMIC BATCH USER )
   MYFILE CL(DATASET ) VOL(STRG02)
   DEFINE - WARNING: RESOURCE NOT PROTECTED
 IEF253I Y111 CREATE SYSUT2 - DUPLICATE NAME ON DIRECT ACCESS VOLUME
 IGD17001I DUPLICATE DATA SET NAME ON VOLUME STRG01
 FOR DATA SET MYFILE
 IGD17001I DUPLICATE DATA SET NAME ON VOLUME STRG03
 FOR DATA SET MYFILE
 IGD17001I DUPLICATE DATA SET NAME ON VOLUME STRG02
 FOR DATA SET MYFILE
 IEF272I Y111 CREATE - STEP WAS NOT EXECUTED.


I'm assuming I made an error the first time i attempted to run this, and that is what is giving me the data set duplication error.
Please help, and thanks so much - Justin
magik5
 
Posts: 8
Joined: Tue Feb 19, 2008 12:17 am
Has thanked: 0 time
Been thanked: 0 time

Re: JCL PRINT assignment help..?

Postby dick scherrer » Tue Feb 19, 2008 1:57 am

Hello Justin and welcome to the forums,

Yup, disp=(new,pass) should be avoided for non-temporary datasets - IMHO, it is better to catlg them and delete them later when they are no longer needed. Due to multiple executions, the file has now been propogated across multiple volumes. You need to write jcl or go into tso/ispf and delete all of the existing copies of the file (either way, you will need to name the volume where each file exists).

Once you have deleted the existing unneeded copies, and change youjr first step to (new,catlg), i berlieve you'll be good to go.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: JCL PRINT assignment help..?

Postby magik5 » Tue Feb 19, 2008 2:45 am

ok, i figured that is what might of happened.
So i created something that i thought would delete the file.
Then probally i would have to add the VOL, and do I need unit.

//Y111 JOB SC064502,
//         CLASS=A,
//         MSGCLASS=X
//SCRATCH  EXEC PGM=IEFBR14
//DD1      DD  DSN=MYFILE,
//             DISP=(OLD,DELETE)
//


Do i have to include the VOL then (STRG01-STRG02) ?

Thanks again for the help...!! - Justin
magik5
 
Posts: 8
Joined: Tue Feb 19, 2008 12:17 am
Has thanked: 0 time
Been thanked: 0 time

Re: JCL PRINT assignment help..?

Postby magik5 » Tue Feb 19, 2008 2:54 am

I couldn't find an EDIT POST but I have good news.
I used this code here and i got condition codes of 000 on all three STRG01-03 on SYSDA.
//Y111 JOB SC064502,
//         CLASS=A,
//         MSGCLASS=X
//SCRATCH  EXEC PGM=IEFBR14
//DD1      DD  DSN=MYFILE,
//             DISP=(OLD,DELETE),
//             UNIT=SYSDA,
//             VOL=SER=STRG03
//


So now I will work on what you told me about CATLG.

Thanks again, and be assured if I run into anymore probs, I won't hesitate to ask ! - Justin
magik5
 
Posts: 8
Joined: Tue Feb 19, 2008 12:17 am
Has thanked: 0 time
Been thanked: 0 time

Re: JCL PRINT assignment help..?

Postby dick scherrer » Tue Feb 19, 2008 3:00 am

Hi Justin,

I couldn't find an EDIT POST but I have good news.
I believe the site admins have restricted self-editing.

//SCRATCH EXEC PGM=IEFBR14
//DD1 DD DSN=MYFILE,
// DISP=(OLD,DELETE),
// UNIT=SYSDA,
// VOL=SER=STRG03
Yup, that would do the trick.

Good luck - someone will be here when there are questions - may take a bit of time, but someone will be here. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: JCL PRINT assignment help..?

Postby magik5 » Tue Feb 19, 2008 3:12 am

Alas, I didn't expect to be done with this so soon. I got the correct output !

I just fixed a few things, In the ADDMORe step i changed the DISP to mod,pass. I also included UNIT and VOL in the two steps were I changed records.

Thansk so much. I have more assignments to do, and If i need to i'll ask more q's.
Thanks - Justin
magik5
 
Posts: 8
Joined: Tue Feb 19, 2008 12:17 am
Has thanked: 0 time
Been thanked: 0 time

Re: JCL PRINT assignment help..?

Postby dick scherrer » Tue Feb 19, 2008 3:32 am

I didn't expect to be done with this so soon. I got the correct output !
Cool ;)

Good luck!

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post