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
 

 

Error in initializing vsam with data

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

New User


Joined: 19 Mar 2008
Posts: 51
Location: Pune

PostPosted: Thu Feb 05, 2009 5:30 pm    Post subject: Error in initializing vsam with data
Reply with quote

Hi All

I am having one jcl/proc which is having steps as below


Step 1.Close vsam file F001 in cics
Step 2.Copy vsam file F001 to gdg
step 3.initialize vsam file F001(here i am deleting & defining vsam file F001 ,then copying below data from another vsam F002 to the vsam F001 ) Note that i am doing this because when program try to open the vsam F001 for writing first record it will not cause any error as file is not empty but unfortunately copy from another vsam F002 to the vsam F001 is not working. I am getting VSAM OPEN RETURN CODE IS 168

Data in F002

REQUEST ID REC OTHER DETAILS

-------------- ------ ---------------------------------------------------

step 4. open vsam file F001 in cics

Step 5 Close vsam file F003 in cics
step 6 initialize vsam file F003 (here i am deleting & defining vsam file F003 ,then copying below data from another vsam F004 to the vsam F003 )Note that i am doing this because when program try to open the vsam F003 for writing first record it will not cause any error as file is not empty but unfortunately copy from another vsam F004 to the vsam F003 is not working. I am getting VSAM OPEN
RETURN CODE IS 168

Data in F004
***************************** Top of Data **
00000000 00000000 01000000
-------- -------- ---------
LAST USED LAST RRN MAX RRN

*
**************************** Bottom of Data *
step 7 open vsam file F003 in cics


Now step 3 & 6 are not working as desired and i am getting condition code of 12.Mainly because of copy of vsam files.
SO i need help here how can i copy above given data in vsam F001 & F003 so that when program uses this two files to write some data this files initially are not empty & program will not abend.

Note - This file are RRDS

Please give your suggestion

Regards
Bijal
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Feb 05, 2009 5:38 pm    Post subject:
Reply with quote

And how do we copy our RRDS to RRDS ?
Back to top
View user's profile Send private message
bijal.awhad

New User


Joined: 19 Mar 2008
Posts: 51
Location: Pune

PostPosted: Thu Feb 05, 2009 5:44 pm    Post subject:
Reply with quote

expat wrote:
And how do we copy our RRDS to RRDS ?



Using IDCAMS
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Feb 05, 2009 5:48 pm    Post subject:
Reply with quote

I sort of guessed that it might be IDCAMS, which function of IDCAMS ?

Also, are the error messages pertaining to the input files or the output files ?

Not sure about this bit, but having closed the files to CICS are they still allocated to CICS.
Back to top
View user's profile Send private message
bijal.awhad

New User


Joined: 19 Mar 2008
Posts: 51
Location: Pune

PostPosted: Thu Feb 05, 2009 6:05 pm    Post subject:
Reply with quote

expat wrote:
I sort of guessed that it might be IDCAMS, which function of IDCAMS ?

Also, are the error messages pertaining to the input files or the output files ?

Not sure about this bit, but having closed the files to CICS are they still allocated to CICS.




I am using Repro
Getting error while opening Output file
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Feb 05, 2009 6:19 pm    Post subject:
Reply with quote

Quote:
Step 1.Close vsam file F001 in cics
Is this CLOSE or CLOSE DISABLE?

Could you post the actual IEC or IDC message instead of just your interpretation of the code returned?
Back to top
View user's profile Send private message
bijal.awhad

New User


Joined: 19 Mar 2008
Posts: 51
Location: Pune

PostPosted: Thu Feb 05, 2009 6:23 pm    Post subject:
Reply with quote

Robert Sample wrote:
Quote:
Step 1.Close vsam file F001 in cics
Is this CLOSE or CLOSE DISABLE?

Could you post the actual IEC or IDC message instead of just your interpretation of the code returned?


I am using CLOSE DISABLE

IDC3300I ERROR OPENING (Output file name)
IDC3351I ** VSAM OPEN RETURN CODE IS 168
IDC0005I NUMBER OF RECORDS PROCESSED WAS 0
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Feb 05, 2009 6:32 pm    Post subject:
Reply with quote

From the MAC manual on IDC3351I:
Quote:
168
The data set is not available for the type of processing specified, or an attempt was made to open a reusable data set with the reset option while another user had the data set open.
I'd say either the file is being used by ANOTHER batch process, or the file isn't being released by CICS.
Back to top
View user's profile Send private message
bijal.awhad

New User


Joined: 19 Mar 2008
Posts: 51
Location: Pune

PostPosted: Thu Feb 05, 2009 6:39 pm    Post subject:
Reply with quote

Robert Sample wrote:
From the MAC manual on IDC3351I:
Quote:
168
The data set is not available for the type of processing specified, or an attempt was made to open a reusable data set with the reset option while another user had the data set open.
I'd say either the file is being used by ANOTHER batch process, or the file isn't being released by CICS.



But how it is possible as I am already closing file in CICS.
Is there any way to check file being released by CICS
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Feb 05, 2009 6:43 pm    Post subject:
Reply with quote

The IDCAMS step that does the delete / define / repro on your FILE001 -- could you please post the IDCAMS statements?
Back to top
View user's profile Send private message
bijal.awhad

New User


Joined: 19 Mar 2008
Posts: 51
Location: Pune

PostPosted: Thu Feb 05, 2009 6:54 pm    Post subject: Reply to: Error in initializing vsam with data
Reply with quote

Here I am posting whole thing
IDCAMS SYSTEM SERVICES TI

DELETE F001 CLUSTER
IDC0550I ENTRY (D) F001.DATA DELETED
IDC0550I ENTRY (C) F001 DELETED
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0

DEFINE CLUSTER (NAME(F001) -
MANAGEMENTCLASS(PERM) STORAGECLASS(STANDARD) -
CYL(250 25) -
VOLUMES(*) -
RECORDSIZE(266 266) -
SHAREOPTIONS(1,3) -
NUMBERED -
SPEED)
IDC0508I DATA ALLOCATION STATUS FOR VOLUME CLI397 IS 0
IDC0512I NAME GENERATED-(D) F001.DATA
IDC0181I STORAGECLASS USED IS STANDARD
IDC0181I MANAGEMENTCLASS USED IS PERM
IDC0181I DATACLASS USED IS DIRECT
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0

REPRO INFILE(F002) -
OUTFILE(F001)
IDC3300I ERROR OPENING F001
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
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Thu Feb 05, 2009 7:15 pm    Post subject: Reply to: Error in initializing vsam with data
Reply with quote

repeat a thousand times
I should read the manual....

Code:
repro infile() outfile()


Code:
INFILE('DNAME/PASSWORD')
           - SPECIFIES THE NAME OF THE DD STATEMENT THAT IDENTIFIES
             THE DATA SET TO BE COPIED.

OUTFILE('DNAME/PASSWORD')
           - SPECIFIES THE NAME OF THE DD STATEMENT THAT IDENTIFIES
             THE OUTPUT DATA SET.


the correct syntax is
Code:
repro infile(inpur_ddname) outdataset(output_dataset_name)

since there is no file01 dd statement the repro fails
Back to top
View user's profile Send private message
bijal.awhad

New User


Joined: 19 Mar 2008
Posts: 51
Location: Pune

PostPosted: Thu Feb 05, 2009 7:38 pm    Post subject: Reply to: Error in initializing vsam with data
Reply with quote

My code is as below

//COPFILE EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INDD2 DD DSN=F002,DISP=SHR
//OUTDD2 DD DSN=F001,DISP=SHR
//SYSIN DD DSN=MY.CTLCDLIB(TEST1),DISP=SHR

Content of control card TEST1
//DELETE F001 CLUSTER
//DEFINE CLUSTER (NAME(F001) -
// MANAGEMENTCLASS(PERM) STORAGECLASS(STANDARD) -
// CYL(250 25) -
// VOLUMES(*) -
/ RECORDSIZE(266 266) -
// SHAREOPTIONS(1,3) -
// NUMBERED
// SPEED)
// REPRO INFILE(INDD2) -
// OUTFILE(OUTDD2)

What is wrong with this?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Feb 05, 2009 7:47 pm    Post subject:
Reply with quote

For a start it is rather different to the code you posted previously.

What is with the // in cc1-2 ?
Back to top
View user's profile Send private message
bijal.awhad

New User


Joined: 19 Mar 2008
Posts: 51
Location: Pune

PostPosted: Thu Feb 05, 2009 7:55 pm    Post subject:
Reply with quote

expat wrote:
For a start it is rather different to the code you posted previously.

What is with the // in cc1-2 ?


My reply was to enrico-sorichetti's reply

I have given actual code of step 3 mentioned in my first post

CC 12 is because Repro is failing.

Thanks
Bijal
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Thu Feb 05, 2009 8:51 pm    Post subject: Reply to: Error in initializing vsam with data
Reply with quote

I whish the TS would explain / describe exactly the steps taken

I reread the whole thread, just to be sure, and nothing in the previous posts
contradicts my analisys

I whish that the posters were a bit more clear in their explanations
and expect them to post congruent data not mix up different things

I would expect in the order a clean cut and paste with the code tags of

1) jcl submitted
2) members used as sysin/parms
3) sysout of the whole job
4) as an alternative a snapshot of all the error messages

if I remember correctly
having a dd statement for a vsam file, deleting and defining it,
and using the same dd will give an error
some control blocks are filled by jcl based on the old allocation
and......
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Feb 05, 2009 9:16 pm    Post subject:
Reply with quote

Enrico: I don't think the posting problems will go away anytime soon -- everybody seems to want to paste what they think we need to see instead of the actual output ... what a time waster!

The VSAM 168 error could definitely be explained by using a DD name in a step that deletes and defines the file, then attempts to repro it -- the VOLUME parameter is (*) so SMS is picking a volume; unless the same volume happened to be used the REPRO is attempting to use a disk pack that doesn't contain the file anymore.

Bijal: based on your last post, you need to change your REPRO to
Code:
REPRO IFILE(OUTDD1) ODS(F001)
since you don't know where the dataset moved after the delete / define. Or, you can break the repro into a separate IDCAMS step in your JCL.
Back to top
View user's profile Send private message
bijal.awhad

New User


Joined: 19 Mar 2008
Posts: 51
Location: Pune

PostPosted: Fri Feb 06, 2009 3:30 pm    Post subject: Reply to: Error in initializing vsam with data
Reply with quote

Enrico & Robert

Finally i used Repro Infile(INDD2) Outdataset(F001) and it worked.

I Appreciate your help

Thank You!

Bijal
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Fri Feb 06, 2009 4:08 pm    Post subject:
Reply with quote

Glad to hear it's working.
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 Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm


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