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
 
To obtain complete one week data taking key in to considerat

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

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Fri Feb 15, 2008 5:25 pm    Post subject: To obtain complete one week data taking key in to considerat
Reply with quote

I'm doing report generation.

Please give me idea, how to write a perform loop so that I can retrieve the complete one week data and write the report retaining the required entities and written in to the report.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Feb 15, 2008 10:36 pm    Post subject:
Reply with quote

Hello,

I'd suggest you re-post your request.

Your requirement is not at all clear. What does a perform loop have to do with a week's processing? What does "write the report retainng the required entities" mean?

If you post a good set of sample data and what you want as output from this process you are asking about, we should be able to offer suggestions.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Fri Feb 15, 2008 11:21 pm    Post subject: Reply to: To obtain complete one week data taking key in to
Reply with quote

I am trying to interpret the O/Q ( original question ) by splitting it into two
parts

1 - given a date calculate the week bounds ( starting and ending dates )
( sunday to saturday / monday to sunday )

2 - how to build a perform loop
in order to take into account only the dates belonging to the computed week
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Sat Feb 16, 2008 2:09 pm    Post subject:
Reply with quote

Hi dick and e.s,

I have read a VSAM file which contains date( for ex: today date) then i have to read complete data of the past wek from the current date, i know i can use counter and by decreasing can achieve it, wat are all the condition i have to look in to plz suggest me.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Sat Feb 16, 2008 3:23 pm    Post subject: Reply to: To obtain complete one week data taking key in to
Reply with quote

Just a hint on the mathematics
use the cobol functions ...
Code:
INTEGER_OF_DATE  from YYYYMMDD           to an absolute number
DATE_OF_INTEGER  from an absolute number to YYYYMMDD   



the result of INTEGER_OF_DATE is nice because the remainder of its division by 7
will give the current day of the week starting from 0 = monday and so on
I' ll use the symbol // to denote such function
and write in universal mathematical notation rather than in cobolese

so ...
given a date in the format YYYYMMDD ( cal_date )

Code:
abs_date         = INTEGER_OF_DATE(cal_date)

day_of week      = abs_date // 7

mon_of_this_week = abs_date - day_of_week
sun_of_this_week = mon_of_this_week + 6

mon_of_prev_week = mon_of_this_week - 7
sun_of_prev_week = sun_of_this_week + 6

You have the relevant week limits axpressed as absolute numbers

the DATE_OF_INTEGER applied to these values will give You the relevant dates in the format YYYYMMDD
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Feb 17, 2008 6:24 am    Post subject:
Reply with quote

Hello,

To add a little to what Enrico has posted - something you may need to consider is the definition of a week. Will it always be exactly 7 days or do things like weekends and holidays have an impact on what is a "week" for your requirement?
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Mon Feb 18, 2008 8:46 am    Post subject:
Reply with quote

Hi e.s and Scherrer.


Your suggestion is very much helpfull......am very thankfull to this forum and you people constantly giving support to individuals.
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 Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am

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