5
! SQR Name: PeopleSoft Outbound Interface AHR802 ! !**********************************************************************! !**********************************************************************! ! ! !Program Name:: .SQR ! ! !  ! Purpose:: ! ! ! ! Date::3/11/2015 ! ! ! ! Created By:: ! ! ! !**********************************************************************! !----------------------------------------------------------------------! ! Modification History ! ! Development: ! ! Inc. Author Date Description ! !--- ---------------- -------- ----------------------------------------! ! ! !----------------------------------------------------------------------! ! Tables: ! !----------------------------------------------------------------------! #include 'setenv.sqc' ! Set Environment Procedure #include 'stdapi.sqc' !Routines to update process scheduler status !*********************************************************************** ! Name : Begin-program ! Purpose: !********************* **************************************************

33333

Embed Size (px)

DESCRIPTION

peoplesoft

Citation preview

Page 1: 33333

7/17/2019 33333

http://slidepdf.com/reader/full/33333-568bd64f8c583 1/5

! SQR Name: PeopleSoft Outbound Interface AHR802 !

!**********************************************************************!

!**********************************************************************!

! !

!Program Name:: .SQR !

! ! 

! Purpose:: !

! !

! Date::3/11/2015 !

! !

! Created By:: !

! !

!**********************************************************************!

!----------------------------------------------------------------------!

! Modification History !

! Development: !

! Inc. Author Date Description !

!--- ---------------- -------- ----------------------------------------!

! !

!----------------------------------------------------------------------!

! Tables: !

!----------------------------------------------------------------------!

#include 'setenv.sqc' ! Set Environment Procedure

#include 'stdapi.sqc' !Routines to update process scheduler status

!***********************************************************************

! Name : Begin-program

! Purpose:

!***********************************************************************

Page 2: 33333

7/17/2019 33333

http://slidepdf.com/reader/full/33333-568bd64f8c583 2/5

Begin-Program

  Do Stdapi-Init

  Do Init-DateTime

  Do Init-Number

Let $FileName = '/u05/pstrans/hr/jobs.txt'

Open $FileName as 1 For-Writing Record=3000:VARY Status=#OpenStat

If #OpenStat <> 0

show 'test'

Show 'Error Opening ' $FileName

Else

show 'File Opened successfully'

Do Write-Header

Do Process_JOBCODE

Do Write-Trailer

Do Close-files

End-If

Display 'Total records written: ' Noline

Display #Tot_Recs 999,999,999

  Do Stdapi-Term

End-Program!************************************************************************!

! Name : Write-Header !

! Purpose: Writing Header to a file!

!************************************************************************!Begin-Procedure Write-Header

encode <09> into $TAB

let $CSVHeader = ''

string 'LINE ID' by $tab into $CSVHeader

string $CSVHeader 'FILE PRODUCTION DATE' by $tab into $CSVHeader

write 1 from $CSVHeader

Page 3: 33333

7/17/2019 33333

http://slidepdf.com/reader/full/33333-568bd64f8c583 3/5

end-procedure

!************************************************************************!

! Name : Write-Trailer!

! Purpose: Writing Trailer to a file!

!************************************************************************!Begin-Procedure Write-Trailer

encode <09> into $TAB

let $CSVTrailer = ''

string 'LINE ID' by $tab into $CSVTrailer

string $CSVHeader 'RECORD COUNT' by $tab into $CSVTrailer

write 1 from $CSVTrailer

end-procedure!************************************************************************!

! Name : Process_JOBCODE !

! Purpose: Selecting required data from table !

!************************************************************************!

Begin-Procedure Process_JOBCODE

Begin-SELECT

A.JOBCODE

A.SAL_ADMIN_PLAN

Do Write-Output-Record 

FROM PS_AGL_EMPYREANIDF A

WHERE A.EFF_STATUS='A'

  AND A.EFFDT = (SELECT MAX(A_ED.EFFDT) FROM PS_JOBCODE_TBL A_ED

WHERE A.SETID = A_ED.SETID

AND A.JOBCODE = A_ED.JOBCODE

AND A_ED.EFFDT <= SYSDATE)

Page 4: 33333

7/17/2019 33333

http://slidepdf.com/reader/full/33333-568bd64f8c583 4/5

 ORDER BY A.JOBCODE

End-Select

End-Procedure

!************************************************************************!

! Name : Write-Output-Record !

! Purpose: writing to the file !

!************************************************************************!

Begin-Procedure Write-Output-Record

encode <09> into $TAB

Write 1 From

 $agl_jobcode

 $Tab

$agl_division

 $Tab

$agl_job_region

 $Tab 

End-Procedure Write-Output-Record 

!****************************************************************************

! Description : Closing files !

!****************************************************************************

Begin-Procedure Close-files

 Close 1

End-Procedure Close-files

!#include 'stdapi.sqc' !Update Process API

#include 'datetime.sqc' !Routines for date and time formatting

#include 'datemath.sqc' !Date Math routines

Page 5: 33333

7/17/2019 33333

http://slidepdf.com/reader/full/33333-568bd64f8c583 5/5

#include 'number.sqc' !Routines to format numbers

#include 'curdttim.sqc' !Get-Current-DateTime procedure

#include 'prcsapi.sqc' !Procedure for Initializing process variables

#include 'prcsdef.sqc' !Defines and initializes th