View previous topic :: View next topic
|
Author |
Message |
deepthijanardhana
New User
Joined: 11 Dec 2006 Posts: 13 Location: bangalore
|
|
|
|
hi frnds
i have one daily job that should have record , if i run on saturday it should have records of saturday and friday but if i run the job on sunday it should only have saturday recordand it should not have the records of sundays...i have to move the records of sundays job to one recycle file. rest to one more file.(this is output file).
Can u guys plz suggest me the way to do it in cobol..
Thanks |
|
Back to top |
|
|
manihcl85 Warnings : 1 New User
Joined: 11 Jan 2007 Posts: 52 Location: chennai
|
|
|
|
Hi,
U can use day command it will give an integer ranging from 0 to 7. find out the value for sunday. then using if loop u can change right.
if i am not clear get back to me.
Regards,
Mani |
|
Back to top |
|
|
deepthijanardhana
New User
Joined: 11 Dec 2006 Posts: 13 Location: bangalore
|
|
|
|
hi,
can u plz explain it in breif.. like i have one date feild in file, how can i proceed .. how can i add the logic. |
|
Back to top |
|
|
deepthijanardhana
New User
Joined: 11 Dec 2006 Posts: 13 Location: bangalore
|
|
|
|
hi,
can u plz explain it in breif.. like i have one date feild in file, how can i proceed .. how can i add the logic. |
|
Back to top |
|
|
deepthijanardhana
New User
Joined: 11 Dec 2006 Posts: 13 Location: bangalore
|
|
|
|
hi,
can u plz explain how to write logic part for this.. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Slow down deepthijanardhana......
One way:
If this is the sunday run, open the sunday output file
read input
if sunday run, and sunday data, write to sunday output, go read again
if not sunday run, report, go read again.
if no more input, close files
if no more input and sunday run, close sunday output.
"All the way, to EOJ" |
|
Back to top |
|
|
manihcl85 Warnings : 1 New User
Joined: 11 Jan 2007 Posts: 52 Location: chennai
|
|
|
|
Hi,
can u please give me an example input file with what format date is there in ur input file. suppose if the job run on monday means it should have both sunday and monday files or what?
Regards,
Mani |
|
Back to top |
|
|
deepthijanardhana
New User
Joined: 11 Dec 2006 Posts: 13 Location: bangalore
|
|
|
|
hi,
this is the input feild date format.
05 DTL-TRAN-DATE G
10 DTL-TRAN-DATECC G
15 DTL-TRAN-DATE-CC C 2
10 DTL-TRAN-DATE-YYMMDD G
15 DTL-TRAN-DATE-YY C 2
15 DTL-TRAN-DATE-MM C 2
15 DTL-TRAN-DATE-DD C 2
How can i check this date as sunday?
and also on monday we run weekly job , so no need to worry abt that. |
|
Back to top |
|
|
manihcl85 Warnings : 1 New User
Joined: 11 Jan 2007 Posts: 52 Location: chennai
|
|
|
|
Hi,
i am not able find the date in ur input file. cobol code is quite a big logic. if u have access to db2 means use the query below. it will return a integer from 1 t0 7 if 1 means sunday using this u can perform ur operation i think.
SELECT DAYOFWEEK (CAST('10/11/1998' AS DATE)) INTO :VAR1
FROM SYSIBM.SYSDUMMY1;
Correct me if i am wrong
Regards,
Mani |
|
Back to top |
|
|
deepthijanardhana
New User
Joined: 11 Dec 2006 Posts: 13 Location: bangalore
|
|
|
|
i have written logic like this . will it work.
it should take,only if today is sunday it should fetch that day data and write it to recycle file else to output file.
ACCEPT WS-SYSTEM-DATE FROM DATE.
IF DAY-OF-WEEK == 7
MOVE DTL-TRAN-DATE (3:6) TO WS-CUR-SUN-DATE.
END-IF.
IF WS-CUR-SUN-DATE = WS-SYSTEM-DATE
MOVE IN-SAFEWAY-RECORD TO OT-RECY-RECORD
ELSE
MOVE IN-SAFEWAY-RECORD TO OT-EXTRACT-RECORD
END-IF. |
|
Back to top |
|
|
manihcl85 Warnings : 1 New User
Joined: 11 Jan 2007 Posts: 52 Location: chennai
|
|
|
|
HI,
Sorry still i am not clear with how ur input file is and what ur doing.
Regards,
Mani |
|
Back to top |
|
|
|