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 |
|---|---|---|
| How to run nvision report through portal | PeopleSoft Technical | 08/31/2010 - 4:45am |
| Any1 here who can help? | PeopleSoft Technical | 08/31/2010 - 2:12am |
| How to create matrix layout | PeopleSoft Technical | 08/27/2010 - 2:22am |
| UnCaught C++ Exception | PeopleSoft Technical | 08/10/2010 - 9:05am |
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