Some times requirement comes to genrate the output file (csv or any other) at the default output directory so that it can be accesible from the Process Monitor's 'View Log/Trace' page.
To achive this below code will be helpful-
begin-procedure Init-Report
do Stdapi-Init
if $prcs_process_instance = ''
!No Prompt
do Ask-As-Of-Date
else
display 'Going to select-parameters'
do Select-Parameters
end-if
do Init_Printer
do Init_Report_Translation ($ReportID, $Language_cd)
if $language_cd = 'JPN'
let $qualifier = 'NAME_AC'
else
let $qualifier = 'NAME'
end-if
do Get-Filename
let $filename1 = '{HRSDIR_OUT}'||'Age-Wage-Distribution.csv'
open $filename as 100 for-writing record=1000:vary status=#filestat
open $filename1 as 101 for-writing record=1000:vary status=#filestat
Let $Report_Title = 'Age and Wage Distribution Report'
WRITE 100 FROM $Report_Title
WRITE 100 FROM ''
WRITE 101 FROM $Report_Title
WRITE 101 FROM ''
end-procedure
!**************************************************************************
begin-procedure Get-Filename
!**************************************************************************
begin-select
R.PRCSOUTPUTDIR &R.PRCSOUTPUTDIR
let $OutputDirectory = &R.PRCSOUTPUTDIR
FROM PSPRCSPARMS R
WHERE R.PRCSINSTANCE = $prcs_process_instance
end-select
!show 'Creating File'
#ifdef UNIX
let $FileName = $OutputDirectory || '/Age-Wage-Distribution.csv'
!show $FileName
#ELSE
let $FileName = $OutputDirectory || '\Age-Wage-Distribution.csv'
!show $FileName
#END-IF
END-PROCEDURE
Regards,
Ganesh Pawar,
Pune
| Title | Under | Posted on |
|---|---|---|
| Abs Mgmt: How can Abs rule pro-rate contractor's last month's entitlement (need help urgently) | PeopleSoft Functional | 03/10/2010 - 9:21pm |
| Can we user LONG datatype as a search option in PeopleSoft | PeopleSoft Technical | 03/10/2010 - 11:22am |
| special caracters are not translated correctly when ftp from windows to unix | Programming | 03/09/2010 - 3:23pm |
| How to view the employees from particular country in peoplesoft? | PeopleSoft Technical | 03/03/2010 - 1:56am |
Comments
To my knowledge , if we use {FILEPREFIX} variable, process direclty creates file in Log output folder and created file is available in process schedular.
Sample code
let $FileName = '{FILEPREFIX}'||xxx.csv
SQR engine is intelligent enough to assign correct value to FILEPREFIX variable.
Post new comment