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
 

 

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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am


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