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

COBOL : How to Get today date without extract from table.


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

New User


Joined: 14 Sep 2005
Posts: 48

PostPosted: Wed Feb 08, 2006 7:32 am
Reply with quote

Hi All..

I need to build a cobol program that can get today date from system(mainframe) without extract from table.. Because i dont want to involve any table..
Is there any function can be use to get today date?

TQ
Back to top
View user's profile Send private message
mrar_160

New User


Joined: 14 Sep 2005
Posts: 48

PostPosted: Wed Feb 08, 2006 8:17 am
Reply with quote

I think i got..
refer www.csis.ul.ie/COBOL/Course/COBOLcommands.htm
But didnt compile yet..
Back to top
View user's profile Send private message
mrar_160

New User


Joined: 14 Sep 2005
Posts: 48

PostPosted: Wed Feb 08, 2006 10:16 am
Reply with quote

Ok..I got it..
Thank you..
Back to top
View user's profile Send private message
spkumar

New User


Joined: 15 Feb 2006
Posts: 3
Location: india

PostPosted: Thu Feb 16, 2006 10:31 am
Reply with quote

i have a doubt regarding the code to be developed for the following description.....
can u please provide me the code for the following description.....
i can't understand the description he has given below,please provide me the code if u know as early as possible....

7. The logic for to get date for Open and Closed work orders is provided below ?
? For Work Orders in closed status (W-WO-STAT = C),
 Month is stored in W-MO ( 1 byte field 38th position) and values are
1-9 respectively from January to September
O - for October
N- November
A - December
 Year is stored in W-YR (1 byte field 39Th position) and values and values are stored in 10 year revolving window fashion.
Like 5 - 2005 and 4 for 2004 and so on.

In program, define an array of 10 positions and always calculate last 10 years based on the processing year.

With this logic we can only get Year and Month for closed work order and only this will be provided. Day portion of this date will be left blank.
Back to top
View user's profile Send private message
balajiofcrrcoe

New User


Joined: 07 Jul 2005
Posts: 41
Location: chennai

PostPosted: Thu Feb 16, 2006 1:27 pm
Reply with quote

Hi,
here is the logic, declare the following data in working-storage section.

77 date-accp pic x(6).
77 month-disp pic x(2).
77 day-disp pic x(2).
77 year-disp pic 9(1).
77 W-MO pic x(1).

code the following lines in procedure division

accept date-accp from date.
display date-accp.
move date-accp(3:2) to month-disp.
move date-accp(5:2) to day-disp.
move date-accp(2:1) to year-disp.
*move 12 to month-disp.
if ( month-disp > 0 and month-disp< 10)
move month-disp(2:1) to W-MO
else
evaluate month-disp
when 10 move 'o' to w-mo
when 11 move 'n' to w-mo
when 12 move 'd' to w-mo
end-evaluate
end-if.
display w-mo.
display year-disp.


delete the comment on the line "move 12 to month-disp" and move 10 or 11 or 12 to check weather it is working for oct,nov,dec.


Regards,
Naga.
Back to top
View user's profile Send private message
spkumar

New User


Joined: 15 Feb 2006
Posts: 3
Location: india

PostPosted: Sat Feb 18, 2006 2:48 pm
Reply with quote

i will compile and check the output.....
regards,
spkumar.
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 Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Load new table with Old unload - DB2 DB2 6
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
Search our Forums:

Back to Top