Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to get Current week data

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
deepthijanardhana

New User


Joined: 11 Dec 2006
Posts: 13
Location: bangalore

PostPosted: Tue Feb 27, 2007 5:21 pm    Post subject: How to get Current week data
Reply with quote

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
View user's profile Send private message

manihcl85
Warnings : 1

New User


Joined: 11 Jan 2007
Posts: 52
Location: chennai

PostPosted: Tue Feb 27, 2007 5:54 pm    Post subject:
Reply with quote

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
View user's profile Send private message
deepthijanardhana

New User


Joined: 11 Dec 2006
Posts: 13
Location: bangalore

PostPosted: Tue Feb 27, 2007 6:40 pm    Post subject: Re: How to get Current week data
Reply with quote

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
View user's profile Send private message
deepthijanardhana

New User


Joined: 11 Dec 2006
Posts: 13
Location: bangalore

PostPosted: Tue Feb 27, 2007 6:40 pm    Post subject: Re: How to get Current week data
Reply with quote

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
View user's profile Send private message
deepthijanardhana

New User


Joined: 11 Dec 2006
Posts: 13
Location: bangalore

PostPosted: Tue Feb 27, 2007 6:44 pm    Post subject: Re: How to get Current week data
Reply with quote

hi,
can u plz explain how to write logic part for this..
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Feb 27, 2007 7:04 pm    Post subject:
Reply with quote

Slow down deepthijanardhana...... icon_rolleyes.gif

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
View user's profile Send private message
manihcl85
Warnings : 1

New User


Joined: 11 Jan 2007
Posts: 52
Location: chennai

PostPosted: Wed Feb 28, 2007 9:56 am    Post subject:
Reply with quote

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
View user's profile Send private message
deepthijanardhana

New User


Joined: 11 Dec 2006
Posts: 13
Location: bangalore

PostPosted: Wed Feb 28, 2007 10:12 am    Post subject: Re: How to get Current week data
Reply with quote

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
View user's profile Send private message
manihcl85
Warnings : 1

New User


Joined: 11 Jan 2007
Posts: 52
Location: chennai

PostPosted: Wed Feb 28, 2007 10:57 am    Post subject:
Reply with quote

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
View user's profile Send private message
deepthijanardhana

New User


Joined: 11 Dec 2006
Posts: 13
Location: bangalore

PostPosted: Wed Feb 28, 2007 10:59 am    Post subject: Re: How to get Current week data
Reply with quote

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
View user's profile Send private message
manihcl85
Warnings : 1

New User


Joined: 11 Jan 2007
Posts: 52
Location: chennai

PostPosted: Wed Feb 28, 2007 11:03 am    Post subject:
Reply with quote

HI,

Sorry still i am not clear with how ur input file is and what ur doing.

Regards,
Mani
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us