IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Report using REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sandra

New User


Joined: 06 Apr 2005
Posts: 27

PostPosted: Sun Feb 11, 2007 11:29 pm
Reply with quote

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
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Sun Feb 11, 2007 11:54 pm
Reply with quote

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
View user's profile Send private message
sandra

New User


Joined: 06 Apr 2005
Posts: 27

PostPosted: Mon Feb 12, 2007 4:34 am
Reply with quote

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
View user's profile Send private message
manihcl85
Warnings : 1

New User


Joined: 11 Jan 2007
Posts: 52
Location: chennai

PostPosted: Mon Feb 12, 2007 12:00 pm
Reply with quote

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
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Mon Feb 12, 2007 3:31 pm
Reply with quote

Hi manihcl85,
Refer to my post on : Sun Feb 11, 2007 5:24 pm
Use [code] and [/code] for improved readability icon_biggrin.gif
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Mon Feb 12, 2007 3:40 pm
Reply with quote

sandra wrote:
...Steve, Would this format be of some help...

Much improved, thank you. icon_biggrin.gif

PS: For info, bbCode is necessarily pedantic about matched pairs - is why you have a couple of floating [b]s...!?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Feb 12, 2007 3:46 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top