The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
COBOL file status 39 jbrubaker UNIX for Dummies Questions & Answers 3 08-03-2006 09:39 AM
Installing RedHat 8.0 onto Dell PowerEdge SC1425 - hdc: status error: status = 0x58 fishsponge Red Hat 5 07-14-2006 02:53 PM
check the status and send an email with status isingh786 Shell Programming and Scripting 3 12-29-2005 07:22 PM
Couldn't open status file /var/samba/STATUS.LCK macdonto UNIX for Dummies Questions & Answers 2 08-08-2001 08:42 AM
file status during FTP sean76 UNIX for Dummies Questions & Answers 3 07-01-2001 10:06 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-11-2007
WS-NFG WS-NFG is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 2
Cobol File Status 41 & 42

I'm new to coding on Unix but have coded with COBOL on mainframe for a number of years. This is driving me nuts. My select clause is like so:
SELECT GRPFILE ASSIGN TO EXTERNAL DISK WS-GRPFILE
ACCESS IS SEQUENTIAL
STATUS IS WS-SORTGRP-STATUS.
my WS declaration:
01 WS-FILENAMES.
05 WS-GRPFILE PIC X(26)
VALUE "/mpux/MCS/DATA/GRPFILE.SRT".

I can open the file with file status "00" and write to it with file status "00" until I have written 1024 records - at which point I get a file status 23 ?? (which used to mean to me that record key not found).
When looking at the physical file I see that nothing has been written so I coded a close when I wrote 1023 records:
IF CNTR = 1023
CLOSE GRPFILE
PERFORM EOJ
END-IF.
I got a status 42 - file already closed. I know for sure its already open but I inserted the following OPEN line giving:
IF CNTR = 1023
OPEN OUTPUT GRPFILE
CLOSE GRPFILE
PERFORM EOJ
END-IF.

Now I get a status 41! Its already opened and its already closed! I tried to "touch" the file so that it was already generated before the original open statement - still opens with a "00" but still gives the same end result. I believe this all has something to do with logical vs physical files but dont know where to take it. Anyone??
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:48 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0