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
 

 

fetch record from Variable length record size PS file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: fetch record from Variable length record size PS file
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    Post subject:
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: 24
Location: bangalore

PostPosted: Tue May 27, 2008 5:38 pm    Post subject: Reply to: fetch record from Variable length record size PS f
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

Senior Member


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

PostPosted: Tue May 27, 2008 5:50 pm    Post subject:
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    Post subject: Reply to: fetch record from Variable length record size PS f
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    Post subject: Re: fetch record from Variable length record size PS file
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    Post subject: Reply to: fetch record from Variable length record size PS f
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

Site Director


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

PostPosted: Tue May 27, 2008 11:10 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm


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