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

Repro OUTFILE error


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

New User


Joined: 10 Apr 2013
Posts: 10
Location: INDIA

PostPosted: Fri May 10, 2013 12:08 pm
Reply with quote

Hi,
Below is the code for copying PS file to VSAM file ..
Code:
//STEP1     EXEC PGM=IDCAMS                                   
//SYSPRINT DD SYSOUT=*                                         
//SYSOUT   DD SYSOUT=                                     
//INDD       DD DISP=SHR,DSN=XYZ.PS.FILE
//OUTDD    DD DISP=SHR,DSN=XYZ.VSAM.FILE                       
//SYSIN    DD *
  DELETE  XYZ.VAM.FILE CLUSTER PURGE                           
  IF MAXCC <=8 THEN SET MAXCC = 0                                       
  DEFINE    CLUSTER  (NAME(XYZ.VSAM.FILE)                -       
                      KEYS(6,0)                                 -       
                      RECORDSIZE(20,20)                         -       
                      REUSE                                     -       
                      TRACKS(45,15))                            -       
            DATA      (NAME(XYZ.VSAM.FILE)          -       
                      FREESPACE(10,15)                          -       
                      CISZ(8192))                               -       
            INDEX     (NAME(XYZ.VSAM.FILE))               
  REPRO INFILE(INDD)                                            -       
            OUTFILE(OUTDD)

when i execute this im getting an error :-
Code:
  REPRO INFILE(INDD)                       
        OUTFILE(OUTDD)                     
IDC3300I  ERROR OPENING G040700.EWK84001   
IDC3351I ** VSAM OPEN RETURN CODE IS 168   
IDC0005I NUMBER OF RECORDS PROCESSED WAS 0 

BUT when i use OUTDATASET instead of OUTFILE the execution is successfull,
can anyone explain me why such error occured.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri May 10, 2013 12:23 pm
Reply with quote

Code:
IDC3300I ERROR OPENING G040700.EWK84001
IDC3351I ** VSAM OPEN RETURN CODE IS 168


Is file open already or not closed?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri May 10, 2013 12:41 pm
Reply with quote

With INFILE(ddname)/OUTFILE(ddname) keywords one can specify DISP=SHR in the JCL, which allows the command to run when the other Job/TSO-user using the dataset has the dataset allocated with shared access. If the other Job/TSO-user has dataset allocated with exclusive control, your Job will not run until other Job/TSO-user releases the dataset; if the other Job/TSO-user is not finished with the file you'll observe what you see.

When you use the INDATASET and OUTDATASET keywords, IDCAMS allocates the datasets with exclusive control and your Job works.

Last, please learn touse BBcode Tags - I've edited your post to add them.
Back to top
View user's profile Send private message
Sheerin banu

New User


Joined: 10 Apr 2013
Posts: 10
Location: INDIA

PostPosted: Fri May 10, 2013 12:43 pm
Reply with quote

The INDD file is closed, and its not in open mode also.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri May 10, 2013 12:45 pm
Reply with quote

Just a guess - ISPF/START - on command line type (TSO) ISRDDN -- F 'your file' -- is it there?
Back to top
View user's profile Send private message
Sheerin banu

New User


Joined: 10 Apr 2013
Posts: 10
Location: INDIA

PostPosted: Fri May 10, 2013 2:40 pm
Reply with quote

using ISRDNN the file is not found , but in 3.4 i could see the file.
and my project requirement is to use INDD and OUTDD
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri May 10, 2013 2:55 pm
Reply with quote

the jcl posted
should have given the messages
Code:
IDC3013I DUPLICATE DATA SET NAME
IDC3009I ** VSAM CATALOG RETURN CODE IS 8 - REASON CODE IS IGG0CLEM-52
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12


because of ...
Code:
  DEFINE    CLUSTER  (NAME(XYZ.VSAM.FILE)                -       
........
            DATA      (NAME(XYZ.VSAM.FILE)          -       
........
            INDEX     (NAME(XYZ.VSAM.FILE))               


note the sloppiness of the TS in using the same name for the three <components> of the cluster

and what about the reference to ...
Code:
IDC3300I  ERROR OPENING G040700.EWK84001   
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri May 10, 2013 3:02 pm
Reply with quote

The duplicate names may be a "side-effect" of "masking" the names for posting - note the misplaced "-" for the continuations.

Can't say that I've used IDCAMS like that. "JCL Allocation" of the dataset, then delete/define, then use the JCL Allocation... I don't know what that would do. Oh, maybe, I do now :-)
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri May 10, 2013 3:12 pm
Reply with quote

anyway the whole shebang is a consequence of the poor knowledge of VSAM data management .

if the cluster is defined with the reuse attribute why not simply define it once and after that use ...
Code:
   REPRO INFILE(INDDNM) OUTFILE(OUTDDNM) REUSE
Back to top
View user's profile Send private message
Sheerin banu

New User


Joined: 10 Apr 2013
Posts: 10
Location: INDIA

PostPosted: Fri May 10, 2013 3:19 pm
Reply with quote

Sorry this was manual error due to the masking . and i have not givem any duplicate names .. for DATA i have given XYZ.VSAM.FILE.DATA and similarly for INDEX ,
The rro message shows :-
IDC3300I ERROR OPENING XYZ.VSAM.FILE
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri May 10, 2013 3:23 pm
Reply with quote

Code:
IDC3300I ERROR OPENING XYZ.VSAM.FILE


Is the outputfile?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri May 10, 2013 3:24 pm
Reply with quote

anyway the last suggestion still stands.
Back to top
View user's profile Send private message
Sheerin banu

New User


Joined: 10 Apr 2013
Posts: 10
Location: INDIA

PostPosted: Fri May 10, 2013 3:27 pm
Reply with quote

Yes it is the output file(OUTDD)
REPRO INFILE(INDD) OUTFILE(OUTDD) REUSE
IDC3300I ERROR OPENING XYZ.VSAM.FILE
IDC3351I ** VSAM OPEN RETURN CODE IS 168

REUSE also not working :-(
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri May 10, 2013 3:35 pm
Reply with quote

Is the delete and creation of the file successful?

Can you please copy paste the entire output?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri May 10, 2013 3:41 pm
Reply with quote

using disp=shr for the output file when doing a REPRO
is just a way to incur into lots of trouble...
use DISP=OLD
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri May 10, 2013 4:06 pm
Reply with quote

Quote:
OUTFILE(ddname)| OUTDATASET(entryname)
identifies the target data set. If a VSAM data set defined with a record length greater than 32760 bytes is to be copied to a sequential data set, your REPRO command will end with an error message. Note:
To avoid picking up incorrect volume information from the original DD statement on a data set that has previously been deleted and redefined in this invocation of IDCAMS and the FILE parameter was specified on the delete, you must specify the OUTDATASET keyword instead of OUTFILE. Alternatively, you can issue the REPRO command in a different step from the step that invoked the delete and define commands.OUTFILE(ddname) specifies the name of a DD statement that identifies the target data set. For VSAM data sets, the data set name can name a path. If the DD statement identifies a SYSOUT data set, the attributes must match those specified in JCL DD Statement for a Target Data Set.
Abbreviation: OFILE

OUTDATASET(entryname) specifies the name of the target data set. If OUTDATASET is specified, the entryname is dynamically allocated with a disposition of OLD. For VSAM data sets, entryname can be that of a path.


From the Manuals
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri May 10, 2013 4:07 pm
Reply with quote

A quick review of what you are doing:
1. Delete the old file
2. Define the new file
3. Copy a sequential file into the old file (NOT the new file)

Move the REPRO to a second IDCAMS step of the job.
Back to top
View user's profile Send private message
Sheerin banu

New User


Joined: 10 Apr 2013
Posts: 10
Location: INDIA

PostPosted: Fri May 10, 2013 4:14 pm
Reply with quote

DISP=OLD also i had tried .. but no luck .. below is the entire error code

DELETE XYZ.VSAM.FILE CLUSTER PURGE
IDC0550I ENTRY (D) XYZ.VSAM.FILE.DATA DELETED
IDC0550I ENTRY (I) XYZ.VSAM.FILE.INDEX DELETED
IDC0550I ENTRY (C) XYZ.VSAM.FILE DELETED
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0

IF MAXCC <=8 THEN SET MAXCC = 0

DEFINE CLUSTER (NAME(XYZ.VSAM.FILE) -
KEYS(6,0) -
RECORDSIZE(20,20) -
REUSE -
TRACKS(45,15)) -
DATA (NAME(XYZ.VSAM.FILE.DATA) -
FREESPACE(10,15) -
CISZ(8192)) -
INDEX (NAME(XYZ.VSAM.FILE.INDEX))
IDC0508I DATA ALLOCATION STATUS FOR VOLUME D2A465 IS 0
IDC0509I INDEX ALLOCATION STATUS FOR VOLUME D2A465 IS 0
IDC0181I STORAGECLASS USED IS SCFWSTST
IDC0181I MANAGEMENTCLASS USED IS D1VSAM
IDC0181I DATACLASS USED IS DEFAULT
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0

REPRO INFILE(INDD) OUTFILE(OUTDD) REUSE
IDC3300I ERROR OPENING
XYZ.VSAM.FILE
IDC3351I ** VSAM OPEN RETURN CODE IS 168
IDC0005I NUMBER OF RECORDS PROCESSED WAS 0
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12

IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 12

WHERE
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri May 10, 2013 4:19 pm
Reply with quote

Also

Can you try to delete and create the vsam file in one step and Repro in the other step?
Back to top
View user's profile Send private message
Sheerin banu

New User


Joined: 10 Apr 2013
Posts: 10
Location: INDIA

PostPosted: Fri May 10, 2013 4:37 pm
Reply with quote

Hi , when i gave REPRO in differnt step it worked , but cant i use in same step ... ?
I think OUTDATASET worked with same step because it makes a exclusive lock on the DATASET ..
correct me if im wrong.

Also to clarify the file i delete is same as the file i create .
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri May 10, 2013 4:54 pm
Reply with quote

did You care to read Pandora-box quote from the manual ???
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri May 10, 2013 4:57 pm
Reply with quote

OUTDATASET worked because it was using the "new" VSAM dataset.

Read what people have posted. If you have to use OUTDD, you'll need to either not delete it at all, or delete/define in a previous step.

Choice from those options is yours, but you can't choose a different option which doesn't work, and which is documented as not working.
Back to top
View user's profile Send private message
Sheerin banu

New User


Joined: 10 Apr 2013
Posts: 10
Location: INDIA

PostPosted: Fri May 10, 2013 5:27 pm
Reply with quote

Thanks all for your valuable comments ..
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri May 10, 2013 6:34 pm
Reply with quote

Quote:
Hi , when i gave REPRO in differnt step it worked , but cant i use in same step ... ?
I think OUTDATASET worked with same step because it makes a exclusive lock on the DATASET ..
correct me if im wrong.

Also to clarify the file i delete is same as the file i create .
You are wrong. OUTDATASET works because it is referencing the NEW data set, not the OLD data set. Putting the REPRO (or the DELETE) in a separate step works because you are then referencing the NEW data set with the OUTFILE. Putting it all in one step will not work because JES allocates the files before the step executes, so using OUTFILE means you are attempting to write data to a data set that no longer exists -- hence the 168 return code.

And the file you delete is the same you create -- we got that the first post. However, the file you REPRO to is not the same as the file you create when using OUTFILE in the same step. This is what you did not get.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Getting Error while trying to establi... DB2 3
Search our Forums:

Back to Top