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
 

 

where to code the file status variable in cobol program?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
rpoornima

New User


Joined: 20 Feb 2007
Posts: 1
Location: chennai

PostPosted: Wed Jan 30, 2008 10:52 am    Post subject: where to code the file status variable in cobol program?
Reply with quote

Hi! This is your First post in our Forums! So please be sure to 1) Use meaningful and descriptive Topic Title 2) Try to post your query in the relevant forum category 3) Make sure your query is not already posted and solved in our forums, Use the Search facility and avoid Reposts! If you are following the above rules, delete this message and post your query here!
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


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

PostPosted: Wed Jan 30, 2008 12:07 pm    Post subject:
Reply with quote

Hi,

You code it in FILE-CONTROL paragraph.

It's an optional clause the FILE-CONTROL paragraph. It monitors the execution of each input-output operation for the file.

When the FILE STATUS clause is specified, the system moves a value into the status key data item after each input-output operation that explicitly or implicitly refers to this file. The value indicates the status of execution of the statement.

Hope this helps.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jan 30, 2008 5:42 pm    Post subject:
Reply with quote

it is a PIC X(02) variable that is in your working-storage. the reference name of the variable is part of the FILE-CONTROL paragraph that Anuj explained.
Back to top
View user's profile Send private message
rag swain

New User


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

PostPosted: Wed Jan 30, 2008 5:55 pm    Post subject: Reply to: where to code the file status variable in cobol pr
Reply with quote

,or,
Code:
 PIC 9(02)
Back to top
View user's profile Send private message
thalapradheep

New User


Joined: 05 Dec 2007
Posts: 4
Location: India

PostPosted: Thu Jan 31, 2008 2:23 pm    Post subject:
Reply with quote

Can File status be a comp variable...
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Thu Jan 31, 2008 6:51 pm    Post subject: Re: Reply to: where to code the file status variable in cobo
Reply with quote

rag swain wrote:
Code:
 PIC 9(02)

Yeah you can use this also but..the system treats it as an alphanumeric item with explicit or implicit USAGE IS DISPLAY.


Quote:
Can File status be a comp variable...

Ah..I feel as if I'm in an interview...but (by god grace ) I'm not an interviewee here ..so ..let me know why this question came in mind?.. tell me this & I'll let you know the answer.. for sure.
Back to top
View user's profile Send private message
thalapradheep

New User


Joined: 05 Dec 2007
Posts: 4
Location: India

PostPosted: Fri Feb 01, 2008 5:54 pm    Post subject:
Reply with quote

Hi,

I was asked this question. I am a new novice in COBOL. So thats y i posted this question.

I referred material too. But all said was "It can be numerical or Alphanumerical". But no material has stated that it can be a comp or not...
Back to top
View user's profile Send private message
jmreddymca
Warnings : 1

New User


Joined: 14 Oct 2007
Posts: 29
Location: Bangalore

PostPosted: Mon Feb 04, 2008 10:28 am    Post subject: Hi poornima
Reply with quote

file-control
under select clause diclare

FILE STATUS IS var1.


working-storage section
01 var1 PIC X(2)
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Mon Feb 04, 2008 7:53 pm    Post subject:
Reply with quote

thalapradheep wrote:
Can File status be a comp variable...
No. It can not be.

I tried it out, there were following error message:
Code:
"FILE STATUS" data-name "COBOL-Data-Name" was not defined as a category alphanumeric data item, a category national data item or as a category numeric data item with either "USAGE DISPLAY" or "USAGE NATIONAL".  The data-name was discarded.
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
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm


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