View previous topic :: View next topic
|
Author |
Message |
sandra
New User
Joined: 06 Apr 2005 Posts: 27
|
|
|
|
EDIT BCIS.F2.REPT1 Data set saved
Command ===> Scroll ===> CSR
-----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
0ACCOUNTN 7897657677 REASON CD R0001
DEBIT 099
ACCOUNT REJECTED
****************************
0ACCOUNTN 7877655666 REASON CD R0002
DEBIT 0076
ACCOUNT REJECTED
****************************
0ACCOUNTN 8766678878 REASON CD R0003
DEBIT 0088
ACCOUNT REJECTED
****************************
Hi,
I am using REXX tool to write a report by reading the above input file
In my report I require the following details if the accounts are rejected.
ACCOUNTN : 7877655666
REASON CD : R0002
ACCOUNT REJECTED.
Using the REXX tool could you please help me. I am not familiar with REXX. In the below code I am getting the number of rejected accounts displayed, but I need the value of ACCOUNTN AND REASON CD displayed
1.Could someone help me with the psedo code or debug the below code ASAP.
2. Could you please help me with the syntax of PARSE VAR. What does R1 1 LBL 31 FT 36 . 10 FS 20 denote.
3. I need to get the value of TFS and TFT displayed i.e value of account number and reason code. In the below code it does not display the value.
"ALLOC DA(?BCIS.F2.REPT1?) F(ACCOUNTS) SHR REUSE"
CTR = 0
SAY "LIST OF REJECTED ACCOUNTS:-"
"EXECIO 1 DISKR ACCOUNTS (STEM R"
DO WHILE(RC=0)
PARSE VAR R1 1 LBL 31 FT 36 . 10 FS 20.
SELECT
WHEN( LBL=" ACCOUNTN " )THEN TFS=FS
WHEN( LBL=" REASON CD " )THEN TFT=FT
WHEN( LBL=" ACCOUNT REJEC" )THEN DO
SAY TFS TFT
CTR = CTR + 1
END
OTHERWISE NOP
END/*SELECT*/
"EXECIO 1 DISKR ACCOUNTS (STEM R"
END
SAY CTR "ACCOUNT REJECTED"
"EXECIO 0 DISKR ACCOUNTS (FINIS"
Thanks in advance. |
|
Back to top |
|
|
Steve Coalbran
New User
Joined: 01 Feb 2007 Posts: 89 Location: Stockholm, Sweden
|
|
|
|
Hi Sandra,
Use the (bb)code...
This looks like monolithic sh1t when you enter it without the bbCode 'code' tag around the 'code'... can you please re-post using...
[code]
...
your formatted stuff goes here
...
[/code]
(and preferably kill the blank lines?) |
|
Back to top |
|
|
sandra
New User
Joined: 06 Apr 2005 Posts: 27
|
|
|
|
Code: |
[b]"ALLOC DA(?BCIS.F2.REPT1?) F(ACCOUNTS) SHR REUSE"
CTR = 0
SAY "LIST OF REJECTED ACCOUNTS:-"
"EXECIO 1 DISKR ACCOUNTS (STEM R"
DO WHILE(RC=0)
PARSE VAR R1 1 LBL 31 FT 36 . 10 FS 20.
SELECT
WHEN( LBL=" ACCOUNTN " )THEN TFS=FS
WHEN( LBL=" REASON CD " )THEN TFT=FT
WHEN( LBL=" ACCOUNT REJEC" )THEN DO
SAY TFS TFT
CTR = CTR + 1
END
OTHERWISE NOP
END/*SELECT*/
"EXECIO 1 DISKR ACCOUNTS (STEM R"
END
SAY CTR "ACCOUNT REJECTED"
"EXECIO 0 DISKR ACCOUNTS (FINIS"
[/b] |
Steve,
Would this format be of some help.
Thanks, |
|
Back to top |
|
|
manihcl85 Warnings : 1 New User
Joined: 11 Jan 2007 Posts: 52 Location: chennai
|
|
|
|
Hi ,
Use the code below to produce the report for ur requirment.
/*************REXX****************/
'FREE ALL'
"ALLOC DA(ur ps name in single quotes) FI(INDD) SHR REUSE"
"EXECIO * DISKR INDD (STEM X. FINIS)"
STR='ACCOUNTN'
DO LIN = 1 TO X.0
PARSE UPPER VAR X.LIN STR1
IF INDEX(STR1,STR) > 0 THEN
DO
OUT1 = SUBWORD(STR1,2,1)
OUT2 = SUBWORD(STR1,5,1)
SAY 'ACCOUNTN: ' OUT1
SAY 'REASON CD : ' OUT2
SAY 'ACCOUNT REJECTED'
END
END
Regards,
Mani |
|
Back to top |
|
|
Steve Coalbran
New User
Joined: 01 Feb 2007 Posts: 89 Location: Stockholm, Sweden
|
|
|
|
Hi manihcl85,
Refer to my post on : Sun Feb 11, 2007 5:24 pm
Use [code] and [/code] for improved readability |
|
Back to top |
|
|
Steve Coalbran
New User
Joined: 01 Feb 2007 Posts: 89 Location: Stockholm, Sweden
|
|
|
|
sandra wrote: |
...Steve, Would this format be of some help... |
Much improved, thank you.
PS: For info, bbCode is necessarily pedantic about matched pairs - is why you have a couple of floating [b]s...!? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Steve Coalbran wrote: |
using...
[code]
...
your formatted stuff goes here
...
[/code] |
Cute way of hiding the "code", burying the other bbCode in the middle...I'll remember that, thanks. |
|
Back to top |
|
|
|