Page 1 of 1

Rexx script for reporting

Posted: Mon Oct 20, 2014 4:13 pm
by Anithab
Hi,

I have a requirement to report

Stepname,ddname,dsn,first part of disposition

For ex :

Code: Select all

//DELETE  EXEC PGM=IEFBR14
//DD01    DD  DSN=ANITHA.TEST,
//            DISP=(MOD,DELETE,DELETE),SPACE=(TRK,(1,1))
//DD02    DD  DSN=ANITHA.TEST2,
//            DISP=(MOD,DELETE,DELETE),SPACE=(TRK,(1,1))
I need a Report like

Code: Select all

DELETE;DD01;ANITHA.TEST;MOD
DELETE;DD02;ANITHA.TEST2;MOD
For programs like

Code: Select all

//DELETE  EXEC PGM=TEST
//INP01    DD  DSN=ANITHA.INP01,DISP=SHR
//         DD  DSN=ANITHA.INP02,DISP=SHR
//OUT01    DD  DSN=ANITHA.OUT01,DISP=OLD
I need report like

Code: Select all

DELETE;INP01;ANITHA.INP01;SHR
DELETE;INP01;ANITHA.INP02;SHR
DELETE;OUT01;ANITHA.OUT01;OLD
At this moment, I am able to retrieve all the values seperately but need pointers how to make them like the one report
Any suggesion will be helpful

Re: Rexx script for reporting

Posted: Tue Oct 21, 2014 3:17 am
by nicc

Code: Select all

this = 'something'
that = 'something else'
say this that
gives:

Code: Select all

somethng something else
Suggest you read up about concatenation as that is a basic part of Rexx.

Re: Rexx script for reporting

Posted: Tue Oct 21, 2014 11:59 am
by Anithab
Thanks Nic

I am aware of the concatenation too...

The issue I am facing is

First record = ' something'
Second record = ' something else'

Though I want like

Code: Select all

something something else 
I get

Code: Select all

something blank 
something something else
Could you throw pointers on where I would have went wrong?

All I do is something like this pseudocode below

Code: Select all

Do i=1 to eof
     IF EXEC found get stepname
     IF DD found get ddname
     IF DSN found dataset_name
     IF DISP found get disp_parm
     say stepname ddname dataset_name   disp_parm    
end
Though I know the logic above is not 100% correct for getting them in one line of reporting I dont know how to correct it

Any advice will help

Thanks

Re: Rexx script for reporting

Posted: Tue Oct 21, 2014 5:11 pm
by zprogrammer
If you are looking for pointers ;)
Try this :
1.Do a read record by record
2.You might need to store some temporary values and counts and based on which you might need be doing the write

Re: Rexx script for reporting

Posted: Tue Oct 21, 2014 8:43 pm
by Anithab
Hi Pandora,

I tried as suggested and I was able to acheieve what I needed.

Thanks all :)

Re: Rexx script for reporting

Posted: Thu Oct 23, 2014 5:03 pm
by zprogrammer
Glad it worked!!
Could you also post the solution which might help others?