Page 1 of 2

How to fetch only package name from the report

PostPosted: Thu Jul 13, 2017 4:13 pm
by dhana venkatesh
I have a project to fetch the package names which is unapproved in changeman. I am able to get the report and place the report in a PS and from that PS an email will be sent to user with the report. The report which is received in email looks like below. But now the challenge is i need only the package name and install date from the below report, is there any chance we can fetch that ? I guess by using REXX it is possible, As i don't have experience in Rexx , can anyone help me with the REXX code ?

1Report CMN970 generated from subsystem: A by: ***** on: 11 Jul 2017 at: 10:28:16 Page: 1 0Date Range 1 Jan 1960 to 11 Jul 2017
-------------------------------------------------------------------------
Packages Pending Approval by Application: Input Package Parm = KW02*
-------------------------------------------------------------------------
Appl Packge Site Install Instal Approver Package Package Prom Sched Requestor name Req
uestor phone
Name Number Name Date Time Entity Status Type Levl System

---- ------ -------- -------- ------ -------- ----------------- -------------- ---- ------ ------------------------- ---
------------
KW02 00000 SITE 20160813 060000 APPSUPA Backed Out Unplanned Perm 00 CMN ABC 137
59
KW02 00000 SITE 20170711 090000 APPSUPA Frozen Planned Perm 00 CMN DEF 989
4184134

Re: How to fetch only package name from the report

PostPosted: Thu Jul 13, 2017 5:03 pm
by prino
Learn REXX, this is a help forum,not a "We do your work for you" one!

Re: How to fetch only package name from the report

PostPosted: Thu Jul 13, 2017 6:06 pm
by Robert Sample
If you ask for code on this forum, you should expect to pay the going rate for it -- 500 to 2000 US dollars per day, depending upon the person. If you don't want to pay, then either learn the language and code it yourself, or use another language you DO know to code what is needed.

Re: How to fetch only package name from the report

PostPosted: Thu Jul 13, 2017 9:37 pm
by Pedro
The requirements are still sketchy... where is this report? Are you the person sending the report or the person receiving the report?

To do this in rexx, you need to study EXECIO, PARSE and maybe SUBSTR. Also, learn how to do a loop.

Re: How to fetch only package name from the report

PostPosted: Thu Jul 13, 2017 11:22 pm
by NicC
You could also probably do it using your sort product but, as you have not used the code tags to show what you are getting nor given an example of what you want, again using the code tags, then it is only a guess,

Re: How to fetch only package name from the report

PostPosted: Tue Jul 18, 2017 8:16 pm
by dhana venkatesh
Pedro wrote:The requirements are still sketchy... where is this report? Are you the person sending the report or the person receiving the report?

To do this in rexx, you need to study EXECIO, PARSE and maybe SUBSTR. Also, learn how to do a loop.



Below which is highlighted is the report . I created a JCL to fetch the report from changeman and same will be getting an email . In this report if you see the last line " KW02 00000 " this is the package name and 20160813 install date which is fetching from changeman, . This report which is below will be saved in a DSN. The person receiving the report in email needs only package name and install date. So I need to work on this report to fetch only package name and install date from this dsn. I hope only using REXX it is possible to fetch these details.

1Report CMN970 generated from subsystem: A by: ***** on: 11 Jul 2017 at: 10:28:16 Page: 1 0Date Range 1 Jan 1960 to 11 Jul 2017
-------------------------------------------------------------------------
Packages Pending Approval by Application: Input Package Parm = KW02*
-------------------------------------------------------------------------
Appl Packge Site Install Instal Approver Package Package Prom Sched Requestor name Req
uestor phone
Name Number Name Date Time Entity Status Type Levl System

---- ------ -------- -------- ------ -------- ----------------- -------------- ---- ------ ------------------------- ---
------------
KW02 00000 SITE 20160813 060000 APPSUPA Backed Out Unplanned Perm 00 CMN ABC 137
59
KW02 00000 SITE 20170711 090000 APPSUPA Frozen Planned Perm 00 CMN DEF 989
4184134

Re: How to fetch only package name from the report

PostPosted: Tue Jul 18, 2017 8:19 pm
by dhana venkatesh
NicC wrote:You could also probably do it using your sort product but, as you have not used the code tags to show what you are getting nor given an example of what you want, again using the code tags, then it is only a guess,



Thanks Nic, I explained the requirement to Pedro, i hope you were also looking for the same. Can you please check the reply to Pedro ?

Re: How to fetch only package name from the report

PostPosted: Tue Jul 18, 2017 9:41 pm
by Pedro
To do this in rexx, you need to study EXECIO, PARSE and maybe SUBSTR. Also, learn how to do a loop.

1. EXECIO to read from your input file
2. a loop to check all input lines
3. use POS built-in function to search for your target text, 'KW02 00000'.
4. EXECIO to write to a new file
5. send the new file to your customer.

Re: How to fetch only package name from the report

PostPosted: Wed Jul 19, 2017 6:56 pm
by dhana venkatesh
Pedro wrote:To do this in rexx, you need to study EXECIO, PARSE and maybe SUBSTR. Also, learn how to do a loop.

1. EXECIO to read from your input file
2. a loop to check all input lines
3. use POS built-in function to search for your target text, 'KW02 00000'.
4. EXECIO to write to a new file
5. send the new file to your customer.


Thanks Pedro. Will try it.

Re: How to fetch only package name from the report

PostPosted: Fri Jul 21, 2017 11:25 am
by NicC
Well, you still have not used the code tags - you found the colour tags so you should have found the code tags. You, also, have still not given the required output from the input that you showed.