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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: COBOL : How to Get today date without extract from table.
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    Post subject:
Reply with quote

I think i got..
refer http://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    Post subject: Re: COBOL : How to Get today date without extract from table
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    Post subject: hi iam satish new 2 this mainframe site
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    Post subject: Re: COBOL : How to Get today date without extract from table
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    Post subject: Re: thank u very much for replying me
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    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 Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
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 Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am


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