View previous topic :: View next topic
|
Author |
Message |
mrar_160
New User
Joined: 14 Sep 2005 Posts: 48
|
|
|
|
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 |
|
|
mrar_160
New User
Joined: 14 Sep 2005 Posts: 48
|
|
Back to top |
|
|
mrar_160
New User
Joined: 14 Sep 2005 Posts: 48
|
|
|
|
Ok..I got it..
Thank you.. |
|
Back to top |
|
|
spkumar
New User
Joined: 15 Feb 2006 Posts: 3 Location: india
|
|
|
|
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 |
|
|
balajiofcrrcoe
New User
Joined: 07 Jul 2005 Posts: 41 Location: chennai
|
|
|
|
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 |
|
|
spkumar
New User
Joined: 15 Feb 2006 Posts: 3 Location: india
|
|
|
|
i will compile and check the output.....
regards,
spkumar. |
|
Back to top |
|
|
|