* #g4gcal_listEvents - List Calendar Events                    *
 *                                                              *
 * Output:                                                      *
 *   out_added - The number of events added.                    *
 *   out_updated - The number of events updated.                *
 *   out_errMsg - The error message (if error exists).          *
 *                                                              *
 * Returns:                                                     *
 *   -1 for error, total number of events                       *
 *                                                              *
 * Settable Variables ([r]=required)                            *
 *   id - Google ID [r]                                         *
 *   calendar_id - Calendar ID [r]                              *
 *   start_date - Start Date (*USA0) [r]                        *
 *   end_date - End Date (*USA0) [r]                            *
 *   event_key - Event Key                                      *
 *   event_option - Event storing option (*REPLACE, *ADD)       *
 *   ccsid - The CCSID to use (1208)                            *
 *   debug - Turn on Debug (*NO, *YES)                          *
 *   debug_file - The debug file name.                          *
 *                 ( /tmp/g4g_[id]_listCalendarsEventsDebug.txt)*
 *                                                              *
D #g4gcal_listEvents...
D                 PR            10i 0
D  out_added                    10i 0
D  out_updated                  10i 0
D  out_errMsg                  256    Options(*NOPASS)

#g4gcal_listEvents will list the events for a specific calendar for a certain ID for the specified time period.  All events will be placed in the file G4GEVTPF

Returns: n for the number of events added and/or updated, -1 for error.

Required Parameters:
  • Events Added (output) - The number of events added to the file.
  • Events Updated (output) - The number of events updated in the file.
Optional Parameters:
  • Error Message (output) - Error message  
Settable Variables (use #g4gcal_setValue):
  • id (required) - Your Google ID
  • calendar_id (required) - The calendar ID to retrieve events for.  This must be a valid value for the Google ID in the field GGCCALID in file G4GCALPF.
  • start_date (required) - *The start date to retrieve events.
  • end_date (required) - *The end date to retrieve events.  
  • event_key - The event key to retrieve events for.  This can further subset the events retrieved as long as events were added with a specific event key.
  • event_option - Enter the option to perform when storing events.  *REPLACE will clear the events from the file for the Calender ID specified before retrieving them.  *ADD will add records to the file, and if a duplicate event is found update it with the most recent information from the calendar.  The default is *REPLACE.
  • ccsid - The CCSID to use.  The default is 1208.
  • debug - Specify *YES to turn on debug, or *NO to turn off debug.  The default is *NO.
  • debug_file - Specify the fully qualified file name for the main debug file.  The default is /tmp/g4g_[id]_listCalendarsEventsDebug.txt
We have found an issue with the event list API provided by Google in that events that are set to start 7pm and later will not be retrieved for that specific day, and will be included on the next day's event list.

For example, if you have an event set to start at 7:30pm on October 26th and you retrieve all the events for October 26th, this even will NOT be retrieved.  But, if you retrieve events for October 27th this event will then be included in the event list.  

This is something we are asking about and hope to get an answer as to why this happens.