Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 6968
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
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us