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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: how to identify date which is in S9(6) COMP-3?
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: 1439
Location: Bangalore,India

PostPosted: Wed Jan 16, 2008 5:40 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10277
Location: italy

PostPosted: Wed Jan 16, 2008 6:30 pm    Post subject: Reply to: how to identify date which is in S9(6) COMP-3?
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    Post subject:
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    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 Could we identify the called modules ... elixir1986 COBOL Programming 5 Fri Jul 14, 2017 1:53 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Identify top 30 big tables or indexes... ashek15 DB2 0 Fri Jun 16, 2017 10:01 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm


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