View previous topic :: View next topic
|
Author |
Message |
krishnakumarramaraj
New User
Joined: 15 Nov 2005 Posts: 15 Location: chennai
|
|
|
|
In the copy book the field is like this:
10 AP-PTD-INVOICE-DATE PIC S9(6) COMP-3.
In the file its value is like this:
+70828.
what i want is?
from this field AP-PTD-INVOICE-DATE i have to identify the year.
if it is 2007 then i have to fetch some fields in that record.
So Pls tell a way to identify the year using cobol. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
krishna,
how do we know your prj standards? The sample value you provided doesn't satisfy any of the standard date formats. speak with your peers. |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
Once you read it in in Cobol you can just do a compare and not worry about what it looks like stored on disk. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
ugly, bad appliaction design, .... add as many as You want !
the data looks like aug. 28 2007
in this case, waiting for an application change for a more robust solution
checking the field for greater than 70000 and less than 80000
will probably give the expected result ( ugly but effective ) |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Code: |
10 AP-PTD-INVOICE-DATE PIC S9(6) COMP-3.
02 workdate pic 9(6).
02 filler redefines workdate.
03 workdate-year pic 99.
03 workdate-mmonth pic 99.
03 workdate-day pic 99.
move AP-PTD-INVOICE-DATE TO WORKDATE. |
On disk or in memory the date would look like x'0070828C' not +70828. |
|
Back to top |
|
|
|