View previous topic :: View next topic
|
Author |
Message |
padmajeet.gaikwad
New User
Joined: 24 Sep 2007 Posts: 2 Location: pune
|
|
|
|
Hi!
I am facing problem in fetching record from Variable length record size PS file through COBOL prog.
it gives me file status =39.
Can some one help me out , as hoe to write FD during coding
|
|
Back to top |
|
|
Apeksha
New User
Joined: 21 May 2008 Posts: 37 Location: Mumbai
|
|
|
|
Hi,
File Status = 39 is if you specify the file of the wrong record length mentioned in the source that of in the JCL.
while writing in FD, recording mode should be V
Hope this is what you needed |
|
Back to top |
|
|
mnnarayankar
New User
Joined: 21 Jan 2008 Posts: 23 Location: bangalore
|
|
|
|
Hi,
Its a file attribute mismatch error. That means LRECL, RECFM, and BLKSIZE value is mismatch between your cobol program and your JCL(using PDS).
Few of the time its File cannot open error because of the above same reason.
do 1 thing check your declared fields in FD section and your column declaration in file. Both should have the same pic clause.
Example:
FD Filename.
01 Record.
05 Pin PIC 9(5).
05 Name PIC X(20).
Then your file must have 5 numeric digit from 1 to 5 and 20 alphanumeric character from 6 to 26.
Regards,
Mohan N. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
Quote: |
Can some one help me out , as hoe to write FD during coding |
sure, but what did you use? Please show a scrap of your code..
From QW:
Quote: |
The OPEN statement was unsuccessful because a conflict was detected between the fixed file attributes and the attributes specified for that file in the program.
These attributes include the organization of the file (sequential, relative, or indexed), the prime record key, the alternate record keys, the code set, the maximum record size, the record type (fixed or variable), and the blocking factor. |
|
|
Back to top |
|
|
rag swain
New User
Joined: 17 Dec 2007 Posts: 33 Location: pune,INDIA
|
|
|
|
How is the file being processed? you should add 4 bytes to LRECL in your JCL(LRECL in pgm+4 bytes) if it is opened in output mode. If you could just post your FD, it would be easy for us to find out your mistake. |
|
Back to top |
|
|
yogeshwar_ade
Active User
Joined: 31 Aug 2006 Posts: 103 Location: INDIA
|
|
|
|
padmajeet.gaikwad wrote: |
Can some one help me out , as hoe to write FD during coding
:roll: |
Have a look on this COBOL Code -
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT INPUT-FILE ASSIGN TO DD-NAME
ORGANIZATION IS SEQUENTIAL
FILE STATUS FILE-STATUS.
FILE SECTION.
FD INPUT-FILE
LABEL RECORDS ARE STANDARD
RECORDING MODE IS V
BLOCK 0 RECORDS
RECORD CONTAINS 25 TO 250 CHARACTERS.
01 FILE-REC PIC X(250).
Here, '25' is the minimum length of the file and '250' is the maximum record length and you have to give 250 as LRECL in your JCL.
Correct me if I am wrong. |
|
Back to top |
|
|
rag swain
New User
Joined: 17 Dec 2007 Posts: 33 Location: pune,INDIA
|
|
|
|
should be max LRECL(in PGM)+4 in your JCL. And also don't forget to mention a rec-len W-S variable which should be unsigned full word binary so that it would justify your process. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello padmajeet.gaikwad and welcome to the forums,
Please post your SELECT, FD, and READ from your cobol program as well as the jcl to execute this program.
As you are reading the file, you shouldn't need dcb info in your jcl - it will be handled automatically. If your variable lentgh data is multple fixed-length records, you do not need to be aware of or control the lrngth. If an individual record might vary in length (due to a "depending on"), you will need to provide for this in your code.
Once you have posted your code/jcl, we will be better abvle to help. |
|
Back to top |
|
|
|