View previous topic :: View next topic
|
Author |
Message |
sakthisiga Warnings : 1 New User
Joined: 11 Jun 2009 Posts: 60 Location: Chennai
|
|
|
|
Hi all,
I could try my level best to write a record into a ESDS file. But it is writing perfectly in Non-vsam file.
In FILE-CONTROL used to write in Non-VSAM file:
Code: |
002800 SELECT REP-FILE ASSIGN TO REPFILE 00330000
010708 ORGANIZATION IS SEQUENTIAL 00340000
010709 ACCESS IS SEQUENTIAL 00350000
010711 FILE STATUS IS W04-RP-STATUS. 00360000
|
and in FD i used:
Code: |
009100 FD REP-FILE 00650000
009200 LABEL RECORDS ARE STANDARD 00660000
009300 BLOCK CONTAINS 0 CHARACTERS 00670000
009400 RECORD CONTAINS 133 CHARACTERS 00680000
009500 RECORDING MODE IS F 00690000
009600 DATA RECORD IS REP-REC. 00700000
009700 01 REP-REC PIC X(133). 00710000
|
Is any modification need for the above code while i use ESDS file? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
If the file is a VSAM ESDS, your COBOL SELECT statement must be in the form
Code: |
ASSIGN TO <comment>-AS-<ddname> |
Please add that and try again.
Quote: |
I could try my level best to write a record into a ESDS file. But it is writing perfectly in Non-vsam file |
What happend you try to write with ESDS, any error message? |
|
Back to top |
|
|
sakthisiga Warnings : 1 New User
Joined: 11 Jun 2009 Posts: 60 Location: Chennai
|
|
|
|
I got the following error:
Code: |
IGZ0200W : A file attribute mismatch was detected. File INP-FILE in program SAMPLE was defined as a physical sequential file and the file specified in the ASSIGN clause was a VSAM data set.
CEE3204S The system detected a protection exception (System Completion Code=0C4).
From compile unit SAMPLE at entry point SAMPLE at compile unit offset +000007B2 at entry offset +000007B2 at address 09300BC2.
|
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
why do You have two threads going on with the same issue... ?
read the cobol manual to understand the difference between a PS file and a VSAM file
Quote: |
IGZ0200W : A file attribute mismatch was detected. File INP-FILE in program SAMPLE was defined as a physical sequential file and the file specified in the ASSIGN clause was a VSAM data set. |
the message could not be more clear
as already pointed out in the other thread define properly the file |
|
Back to top |
|
|
sakthisiga Warnings : 1 New User
Joined: 11 Jun 2009 Posts: 60 Location: Chennai
|
|
|
|
I tried enrico sorichetti...
Its not working..
Is any changes i have to do in the above mention description? |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Hi,
Code: |
002800 SELECT REP-FILE ASSIGN TO REPFILE 00330000
010708 ORGANIZATION IS SEQUENTIAL 00340000
010709 ACCESS IS SEQUENTIAL 00350000
010711 FILE STATUS IS W04-RP-STATUS. 00360000 |
Please change Assign clause to AS-REPFILE as Anuj said.
Code: |
002800 SELECT REP-FILE ASSIGN TO AS-REPFILE 00330000
010708 ORGANIZATION IS SEQUENTIAL 00340000
010709 ACCESS IS SEQUENTIAL 00350000
010711 FILE STATUS IS W04-RP-STATUS. 00360000 |
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Problem 1: your sample code refers to REP-FILE yet your error message refers to INP-FILE. Don't give us what you think we want to know, post the actual, real live code or don't expect a whole lot of help -- we cannot read your mind and know which file you're referring to.
Problem 2: the error message indicates that COBOL believes the file to be a VSAM ESDS file yet the file pointed to by the DD statement is not a VSAM ESDS. You can change your COBOL program, or you can change your file -- your choice. |
|
Back to top |
|
|
sakthisiga Warnings : 1 New User
Joined: 11 Jun 2009 Posts: 60 Location: Chennai
|
|
|
|
Thanks for your help himanshu7....
Its working now... |
|
Back to top |
|
|
sakthisiga Warnings : 1 New User
Joined: 11 Jun 2009 Posts: 60 Location: Chennai
|
|
|
|
Thanks for your advice Robert sample.
Reason for problem 1: After taking the COBOL code out, i just changed my COBOL code from REP-FILE to INP-FILE. after that i compiled and ran that.. that it was not work, then only i took the spool error message.
I apologizes for the mistake I done to wasted your time....
Reason for Problem 2: In DD statement the file given is ESDS file only... after getting idea from himanshu7, i changed my program.... and now its working... |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
aaarghhhh....
sakthisiga wrote: |
After taking the COBOL code out, i just changed my COBOL code from REP-FILE to INP-FILE. after that i compiled and ran that.. |
How would I, for one, know this? I tell you one truth... I'm just an IT-Application-Engineer though 'am from Electronics and Instrumentation background and there in my college I exprimented a lot with actuators and sensors -- but could never succeed to read a mind, trust me.
Quote: |
Reason for Problem 2: In DD statement the file given is ESDS file only... after getting idea from himanshu7, i changed my program.... and now its working... |
Please be honest -- did you ever bothered to read the very first response in this thread for your query? |
|
Back to top |
|
|
sakthisiga Warnings : 1 New User
Joined: 11 Jun 2009 Posts: 60 Location: Chennai
|
|
|
|
Sorry Anuj Dhawan.....
I can't able to understand the syntax you specified in your first post. But your help was also very usefull for me, because i came to know that sytanx from uir first post itself... |
|
Back to top |
|
|
|