View previous topic :: View next topic |
Author |
Message |
nadh Intermediate
Joined: 08 Oct 2004 Posts: 192 Topics: 89
|
Posted: Thu Jun 26, 2008 6:41 am Post subject: FILE-STATUS |
|
|
Hi,
Can we declare FILE-STATUS as PIC 99? Why its is written in books as we have to declare it as PIC XX. Please clarify.
Cheers!!!
Nadh |
|
Back to top |
|
|
jsharon1248 Intermediate
Joined: 08 Aug 2007 Posts: 291 Topics: 2 Location: Chicago
|
Posted: Thu Jun 26, 2008 7:59 am Post subject: |
|
|
Yes. PIC 99 is covered by the second description.
Code: | The status key data item can be defined in the working-storage, local-storage,
or linkage sections as either of the following:
- A two-character alphanumeric item
- A two-character numeric data item, with explicit or implicit USAGE IS
DISPLAY. It is treated as an alphanumeric item. |
|
|
Back to top |
|
|
nadh Intermediate
Joined: 08 Oct 2004 Posts: 192 Topics: 89
|
Posted: Thu Jul 03, 2008 5:40 am Post subject: |
|
|
HI,
Thankyou.
Since its declared as USAGE IS DISPLAY the PIC will be treated as alphanumeric. My doubt is I have never seen Alphabetic error codes in FILE-STATUS. Even then why it is declared as PIC xx.
Please give me the solution.
Cheers!!!
Nadh |
|
Back to top |
|
|
superk Advanced
Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Thu Jul 03, 2008 8:10 am Post subject: |
|
|
Nadh, as someone who's not a programmer, I don't always understand how you guys look at things from a logic standpoint.
If you have a value such as FILE-STATUS, which by definition is something you would never, ever, be performing calculations on, then it makes no logical sense to declare it as anything BUT alpha-numeric. To me, the same logic would hold true for other non-calculatable numeric values like account numbers or PIN numbers or ID numbers, etc. |
|
Back to top |
|
|
jsharon1248 Intermediate
Joined: 08 Aug 2007 Posts: 291 Topics: 2 Location: Chicago
|
Posted: Thu Jul 03, 2008 8:14 am Post subject: |
|
|
The manuals don't explain 'why'. They just tell you to use either PIC XX or PIC 99 to make it work. That's the convention. If you don't like the XX version, just use the 99 version. |
|
Back to top |
|
|
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Thu Jul 03, 2008 3:12 pm Post subject: |
|
|
Currently, only numeric values populate the 2-character FILE-STATUS. Who knows what might happen in the future? _________________ ....Terry |
|
Back to top |
|
|
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Thu Jul 03, 2008 11:21 pm Post subject: |
|
|
Correction: That should be FILE STATUS not FILE-STATUS. _________________ ....Terry |
|
Back to top |
|
|
nadh Intermediate
Joined: 08 Oct 2004 Posts: 192 Topics: 89
|
Posted: Fri Jul 04, 2008 4:08 am Post subject: |
|
|
Hi,
Thankyou Terry.
I've got the below information for it.
The first character of the file-status-key is known as status-key-1; the second character is known as status-key-2.If status-key-1 is a nine (9) then status key 2 is "implementor-defined". Many vendors take advantage of the x"00' to x'FF' (or 0-255) binary value. Therefore, the file status key may not always be a numeric value.
Cheers!!!
Nadh |
|
Back to top |
|
|
|
|