IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to identify date which is in S9(6) COMP-3?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
krishnakumarramaraj

New User


Joined: 15 Nov 2005
Posts: 15
Location: chennai

PostPosted: Wed Jan 16, 2008 5:25 pm
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Jan 16, 2008 5:40 pm
Reply with quote

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
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Wed Jan 16, 2008 6:08 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jan 16, 2008 6:30 pm
Reply with quote

Quote:
+70828

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Jan 16, 2008 6:35 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts How to identify the transaction categ... IMS DB/DC 3
Search our Forums:

Back to Top