[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
RE: [sqr-users] Re: Trying to write 3 outputs from the sameSQR.(Aguirre, Jose)
- Subject: RE: [sqr-users] Re: Trying to write 3 outputs from the sameSQR.(Aguirre, Jose)
- From: "Aguirre, Jose" <JAguir@lsuhsc.edu>
- Date: Thu, 31 Aug 2006 15:12:27 -0500
- Delivery-date: Thu, 31 Aug 2006 16:15:12 -0400
- In-reply-to: <2e41639b122589346a1b3233f4fb698b@earthlink.net>
- List-id: "This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions." <sqr-users.sqrug.org>
- Thread-index: AcbNMkc1Jc4dqeySR2iieHi9cAKWVgAB2rdQ
- Thread-topic: [sqr-users] Re: Trying to write 3 outputs from the sameSQR.(Aguirre, Jose)
Thank you all - I got it working.
José A. Aguirre
-----Original Message-----
From: sqr-users-bounces+jaguir=lsuhsc.edu@sqrug.org
[mailto:sqr-users-bounces+jaguir=lsuhsc.edu@sqrug.org] On Behalf Of William R
Cartmill
Sent: Thursday, August 31, 2006 2:17 PM
To: sqr-users@sqrug.org
Subject: [sqr-users] Re: Trying to write 3 outputs from the same SQR.(Aguirre,
Jose)
SQR treats anything on the same line after an End-Procedure as a comment.
The problem is in your write statements. SQR uses a hyphen/dash, "-" as a
continuation character. In all of your write-... procedures the last field in
the write has a hyphen indicating to SQR that there should be another line
after that one with another field but the only thing after those lines is the
End-Procedure statement. So it's seeing the End-Procedure as part of the write
and not as an end-procedure so it thinks it has two begin-procedure statements
without an end-procedure.
Hence the "(SQR 3702) Command not allowed in this section:
begin-procedure Begin-Procedure Process-Vendor-Address" error and all the
others.
==================================================
WR Cartmill
Technical Consultant, Client Integration Services ADP Financial and Compliance
Services
Voice: 510/645-1055
FAX: 510/217-6123
email: wrcartmill@earthlink.net
On Aug 31, 2006, at 3:04, sqr-users-request@sqrug.org wrote:
>
> From: kota vijayalakshmi <kota_vl@yahoo.com>
> Date: August 30, 2006 16:22:23 PDT
> To: "This list is for discussion about the SQR database reporting
> language from Hyperion Solutions." <sqr-users@sqrug.org>
> Subject: Re: [sqr-users] Trying to write 3 outputs from the same SQR.
> Reply-To: "This list is for discussion about the SQR database
> reporting language from Hyperion Solutions." <sqr-users@sqrug.org>
>
>
> Hi,
>
> Here is one mistake I found from the code:
>
> Instead of "End-Procedure Process-Vendor-Status" you coded it as
> "End-Procedure Process-Vendor-Address".
>
> Correct it and see.
>
> -VJ
>
> "Aguirre, Jose" <JAguir@lsuhsc.edu> wrote:
> Here are my erros:
>
> Error on line 168:
> (SQR 3503) Unknown variable type.
> write 1 from $SETID_VNDR:5 -
>
> Error on line 168:
> (SQR 3503) Unknown variable type.
> write 1 from $SETID_VNDR:5 -
>
> Error on line 172:
> (SQR 3702) Command not allowed in this section: begin-procedure
> Begin-Procedure Process-Vendor-Address
>
> Error on line 238:
> (SQR 3503) Unknown variable type.
> write 2 from $SETID_VNDR_ADDR:5 -
>
> Error on line 238:
> (SQR 3503) Unknown variable type.
> write 2 from $SETID_VNDR_ADDR:5 -
>
> Error on line 241:
> (SQR 3702) Command not allowed in this section: begin-procedure
> Begin-Procedure Process-Vendor-Status
>
> Error on line 283:
> (SQR 3503) Unknown variable type.
> write 3 from $FIELDVALUE:18 -
>
> Error on line 283:
> (SQR 3503) Unknown variable type.
> write 3 from $FIELDVALUE:18 -
>
>
> Here is my DQR syntax:
>
> !******************************
> Begin-Report
> !******************************
>
> do Init-Report
>
> IF $file_open1 = 'Y'
> do Process-Vendor
> END-IF
>
> IF $file_open2 = 'Y'
> do Process-Vendor-Address
> END-IF
>
> IF $file_open3 = 'Y'
> do Process-Vendor-Status
> END-IF
>
> ! display ''
> ! display 'Process Ended at: ' noline
> do Get-Current-Datetime
> display $AsOfNow
>
> ! do StdAPI-Term
>
> End-Report
>
> !******************************
> Begin-Procedure Init-Report
> !******************************
>
> do Init-Datetime
> do Init-Number
> do Get-Current-DateTime
>
> move 'ZZPO0027.SQR' to $ReportID
>
> do Format-DateTime($AsOfToday, $ReportDate, {DEFDATE}, '', '') let
> $DateStr = $ReportDate
>
> Let $ReportFile1 = 'FOLDER_PATH1\VENDOR' || '.txt'
> Let $ReportFile2 = 'FOLDER_PATH2\VENDOR_ADDRESS' || '.txt'
> Let $ReportFile3 = 'FOLDER_PATH3\VENDOR_STATUS' || '.txt'
>
> !DISPLAY $ReportFile1
> !DISPLAY $ReportFile2
> !DISPLAY $ReportFile3
>
> open $ReportFile1 as 1 for-writing record=400 status=#status
>
> if #filestat != 0
> let $error_lit = 'error opening file'
> display $error_lit
> display $file ()
> else
> let $file_open1 = 'Y'
> display 'successful opening the file'
> end-if
>
> open $ReportFile2 as 2 for-writing record=400 status=#status
>
> if #filestat != 0
> let $error_lit = 'error opening file'
> display $error_lit
> display $file ()
> else
> let $file_open2 = 'Y'
> display 'successful opening the file'
> end-if
>
>
> open $ReportFile3 as 3 for-writing record=400 status=#status
>
> if #filestat != 0
> let $error_lit = 'error opening file'
> display $error_lit
> display $file ()
> else
> let $file_open3 = 'Y'
> display 'successful opening the file'
> end-if
>
> End-Procedure Init-Report
>
>
> ! *****************************************
> Begin-Procedure Process-Vendor
> ! *****************************************
>
> !write 1 from 'Begin select Vendor'
>
> Begin-SELECT
> A.SETID
> A.VENDOR_ID
> A.NAME1
> A.NAME2
> A.VENDOR_STATUS
> A.WTHD_SW
> A.VNDR_TIN
> B.TIN
> B.TIN_TYPE
> B.EFF_STATUS
>
> let $SETID_VNDR = rtrim(&A.SETID, ' ') let $VENDOR_ID_VNDR =
> rtrim(&A.VENDOR_ID, ' ') let $NAME1 = rtrim(&A.NAME1, ' ') let $NAME2
> = rtrim(&A.NAME2,' ') let $VENDOR_STATUS = rtrim(&A.VENDOR_STATUS,' ')
> let $WTHD_SW = rtrim(&A.WTHD_SW,' ') let $VNDR_TIN =
> rtrim(&A.VNDR_TIN,' ') let $TIN = rtrim(&B.TIN,' ') let $TIN_TYPE =
> rtrim(&B.TIN_TYPE,' ') let $EFF_STATUS = rtrim(&B.EFF_STATUS,' ')
>
> do Write-Vendor
>
> FROM
> PS_VENDOR A, PS_VENDOR_WTHD B
> WHERE A.SETID = B.SETID
> AND A.VENDOR_ID = B.VENDOR_ID
> ORDER BY A.SETID, A.VENDOR_ID, A.NAME1 End-SELECT
>
> End-Procedure Process-Vendor
>
> ! ********************************************
> Begin-Procedure Write-Vendor
> ! ********************************************
>
> !WRITE 1 FROM 'BEGIN WRITE Vendor'
>
> write 1 from $SETID_VNDR:5 -
> $VENDOR_ID_VNDR:10 -
> $NAME1:40 -
> $NAME2:40 -
> $VENDOR_STATUS:1 -
> $WTHD_SW:1 -
> $VNDR_TIN:10 -
> $TIN:20 -
> $TIN_TYPE:1 -
> $EFF_STATUS:1 -
>
> !WRITE 1 FROM 'END WRITE Vendor'
>
> End-Procedure Write-Vendor
>
>
> ! *****************************************
> Begin-Procedure Process-Vendor-Address !
> *****************************************
>
> !write 2 from 'Begin Vendor-Address'
>
> Begin-SELECT
> C.SETID
> C.VENDOR_ID
> C.EFF_STATUS
> C.NAME1
> C.NAME2
> C.ADDRESS1
> C.ADDRESS2
> C.ADDRESS3
> C.ADDRESS4
> C.CITY
> C.STATE
> C.POSTAL
> C.COUNTRY
>
> let $SETID_VNDR_ADDR = rtrim(&C.SETIDR, ' ') let $VENDOR_ID_VNDR_ADDR
> = rtrim(&C.VENDOR_ID, ' ') let $EFF_STATUS_VNDR_ADDR =
> rtrim(&C.EFF_STATUS,' ') let $NAME1_ADDR = rtrim(&C.NAME1,' ') let
> $NAME2_ADDR = rtrim(&C.NAME2,' ') let $ADDRESS1 = rtrim(&C.ADDRESS1,'
> ') let $ADDRESS2 = rtrim(&C.ADDRESS2,' ') let $ADDRESS3 =
> rtrim(&C.ADDRESS3,' ') let $ADDRESS4 = rtrim(&C.ADDRESS4,' ') let
> $CITY = rtrim(&C.CITY,' ') let $COUNTY = rtrim(&C.COUNTY,' ') let
> $STATE = rtrim(&C.STATE,' ') let $POSTAL = rtrim(&C.POSTAL,' ')
>
> do Write-Process-Vendor-Address
>
> FROM PS_VENDOR_ADDR C
> ORDER BY C.SETID, C.VENDOR_ID
> End-SELECT
>
> End-Procedure Process-Vendor-Address
>
> ! ********************************************
> Begin-Procedure Write-Process-Vendor-Address !
> ********************************************
>
> !WRITE 2 FROM 'BEGIN WRITE Vendor-Address'
>
>
> write 2 from $SETID_VNDR_ADDR:5 -
> $VENDOR_ID_VNDR_ADDR:10 -
> $EFF_STATUS_VNDR_ADDR:1 -
> $ADDRESS1:10 -
> $NAME1_ADDR:40 -
> $NAME2_ADDR:40 -
> $ADDRESS1:35 -
> $ADDRESS2:35 -
> $ADDRESS3:35 -
> $ADDRESS4:35 -
> $CITY:30 -
> $COUNTY:35 -
> $STATE:10 -
> $POSTAL:35 -
>
> !WRITE 2 FROM 'END WRITE Vendor-Address'
>
> End-Procedure Write-Process-Vendor-Address
>
> ! *****************************************
> Begin-Procedure Process-Vendor-Status
> ! *****************************************
>
> !write 3 from 'Begin Vendor-Status'
>
> Begin-SELECT
> D.FIELDVALUE
> D.EFF_STATUS
> D.EFFDT
> D.XLATLONGNAME
> D.XLATSHORTNAME
>
> let $FIELDVALUE = rtrim(&D.FIELDVALUE, ' ') let $EFF_STATUS =
> rtrim(&D.EFF_STATUS, ' ') let $EFFDT = rtrim(&D.EFFDT,' ') let
> $XLATLONGNAME = rtrim(&D.XLATLONGNAME,' ') let $XLATSHORTNAME =
> rtrim(&D.XLATSHORTNAME,' ')
>
> do Write-Process-Vendor-Status
>
> FROM XLATTABLE D
> WHERE D.FIELDNAME ='VENDOR_STATUS'
> End-SELECT
>
> End-Procedure Process-Vendor-Address
>
>
> ! ********************************************
> Begin-Procedure Write-Process-Vendor-Status !
> ********************************************
>
> !WRITE 3 FROM 'BEGIN WRITE Vendor-Address'
>
>
> write 3 from $FIELDVALUE:18 -
> $EFF_STATUS:1 -
> $EFFDT:10 -
> $XLATLONGNAME:30 -
> $XLATSHORTNAME:10 -
>
> !WRITE 3 FROM 'END WRITE Vendor-Status'
>
> End-Procedure Write-Process-Vendor-Status
>
> ! ===================== INCLUDE FILES ============================
> !#include 'askaod.sqc' !Ask As Of Date Procedure !#include
> 'curdttim.sqc' !Get-Current-DateTime Procedure #include 'datetime.sqc'
> !Routines for date and time formatting #include 'number.sqc' !Routines
> for number formatting #include 'stdapi.sqc' !Update Process API !
> ===============================================================
>
> Thanks,
>
> José A. Aguirre
>
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org
> http://www.sqrug.org/mailman/listinfo/sqr-users
>
>
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users