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

fetch record from Variable length record size PS file


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
padmajeet.gaikwad

New User


Joined: 24 Sep 2007
Posts: 2
Location: pune

PostPosted: Tue May 27, 2008 4:36 pm
Reply with quote

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
icon_rolleyes.gif
Back to top
View user's profile Send private message
Apeksha

New User


Joined: 21 May 2008
Posts: 37
Location: Mumbai

PostPosted: Tue May 27, 2008 4:50 pm
Reply with quote

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
View user's profile Send private message
mnnarayankar

New User


Joined: 21 Jan 2008
Posts: 23
Location: bangalore

PostPosted: Tue May 27, 2008 5:38 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Tue May 27, 2008 5:50 pm
Reply with quote

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
View user's profile Send private message
rag swain

New User


Joined: 17 Dec 2007
Posts: 33
Location: pune,INDIA

PostPosted: Tue May 27, 2008 5:58 pm
Reply with quote

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
View user's profile Send private message
yogeshwar_ade

Active User


Joined: 31 Aug 2006
Posts: 103
Location: INDIA

PostPosted: Tue May 27, 2008 5:59 pm
Reply with quote

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
View user's profile Send private message
rag swain

New User


Joined: 17 Dec 2007
Posts: 33
Location: pune,INDIA

PostPosted: Tue May 27, 2008 6:06 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 27, 2008 11:10 pm
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top