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 |
|---|---|---|
| nVision Tabular Report through PIA with prompts | PeopleSoft Technical | 02/02/2012 - 10:07pm |
| Can we create an AE to mass update Position - Jobcode data? | PeopleSoft Technical | 01/18/2012 - 3:11am |
| Pay Components on job data can be defaulted and setup based on the rules? | PeopleSoft Functional | 01/05/2012 - 4:58am |
| PSFT Authentication token failed for Node PSFT_HR | PeopleSoft Technical | 01/03/2012 - 12:21am |
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