Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Report using REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Report using REXX
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: 85
Location: Stockholm, Sweden

PostPosted: Sun Feb 11, 2007 11:54 pm    Post subject: Re: Report using REXX
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    Post subject: Re: Report using REXX
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    Post subject:
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: 85
Location: Stockholm, Sweden

PostPosted: Mon Feb 12, 2007 3:31 pm    Post subject: Re: Report using REXX
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: 85
Location: Stockholm, Sweden

PostPosted: Mon Feb 12, 2007 3:40 pm    Post subject: Re: Report using REXX
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: 3158
Location: Tucson AZ

PostPosted: Mon Feb 12, 2007 3:46 pm    Post subject: Re: Report using REXX
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us