How to fetch only package name from the report



IBM's Command List programming language & Restructured Extended Executor

Re: How to fetch only package name from the report

Postby dhana venkatesh » Fri Jul 21, 2017 4:17 pm

NicC wrote: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.


Nic, Didnt understand what you say ? The output should be only the pakcage name and package date from the report which i showed in blue font
dhana venkatesh
 
Posts: 31
Joined: Thu Mar 06, 2014 6:53 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Re: How to fetch only package name from the report

 

Re: How to fetch only package name from the report

Postby NicC » Fri Jul 21, 2017 5:01 pm

You know what the package name looks like and where it is in the report and the same for the package date. We do not. If you showed your required output then we could come to a reasonable solution but otherwise it is guesswork. Also, what format do you want your report#? This
pckgname pckgdate

or this
pckgname
pckgdate

or something else?
And showing something in a different colour does not enable us to see the actual format of your source. You need the code tags for that - they stop extra spaces being stripped out.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2751
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 110 times

Re: How to fetch only package name from the report

Postby dhana venkatesh » Fri Jul 21, 2017 9:23 pm

NicC wrote:You know what the package name looks like and where it is in the report and the same for the package date. We do not. If you showed your required output then we could come to a reasonable solution but otherwise it is guesswork. Also, what format do you want your report#? This
pckgname pckgdate

or this
pckgname
pckgdate

or something else?
And showing something in a different colour does not enable us to see the actual format of your source. You need the code tags for that - they stop extra spaces being stripped out.


HI Nic,
Below is the report which i used before, as you said i used code tag.Hope it is clear now. In the bottom of the report you can see the package name starts with KW020000 and next to that the install date is there. In the output i need only package name and install date from the below report.


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
 Name Number   Name    Date    Time   Entity       Status          Type         Levl System
 
 ---- ------ -------- -------- ------ -------- ----------------- -------------- ---- ------ -------------------------
 KW02 00000  SITE     20160813 060000 APPSUPA  Backed Out        Unplanned      Perm 00     CMN ABC
 KW02 00000  SITE     20170711 090000 APPSUPA  Frozen            Planned        Perm 00     CMN DEF
 


I need to output like below
Example
KW0200000 20160813
dhana venkatesh
 
Posts: 31
Joined: Thu Mar 06, 2014 6:53 pm
Has thanked: 3 times
Been thanked: 0 time

Re: How to fetch only package name from the report

Postby NicC » Sat Jul 22, 2017 12:03 pm

Because you did not do a simple cut and paste from your report data set into the reply box a lot of alignment has gone. I have tried to re-assemble the alignment so that the report looks like it does in your browse session. The liens were too long so I cut out the last field (phone number of requestor) as it was irrelevant to your problem and now everything fits. If you had done the original cut and paste into the reply box, added code tags and previewed your post you could have seen what editing needed to be done.

I can now see that all you want is to ignore lines that do not have a package name in the first field and parse the detail lines to split it into the fields you want.
The simplest PARSE statement is:
PARSE VAR detail_line appl_name package_number . install_date .

You then simply concatenate the 3 extracted fields to create your output line.
However, I would have thought that it would be better to have a header line with the date and time that you extracted the data from the report and a trailer line with the count of records written.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
dhana venkatesh (Wed Oct 25, 2017 2:19 pm)
NicC
Global moderator
 
Posts: 2751
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 110 times

Re: How to fetch only package name from the report

Postby enrico-sorichetti » Sat Jul 22, 2017 6:09 pm

there is just one little problem ...
how to identify the line(s) which contain a valid(*) package name

(*) valid as satisfying the TS requirement
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort

These users thanked the author enrico-sorichetti for the post:
dhana venkatesh (Wed Oct 25, 2017 2:19 pm)
enrico-sorichetti
Global moderator
 
Posts: 2702
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 139 times

Re: How to fetch only package name from the report

Postby Pedro » Thu Jul 27, 2017 3:25 am

Just a guess...
KW02 00000  SITE     20160813 060000 -->  Backed Out  
KW02 00000  SITE     20170711 090000 -->  Frozen      

because of 'backed out', I would guess 20160813 is not the right one. Frozen does sound right either.
Pedro Vera

These users thanked the author Pedro for the post:
dhana venkatesh (Wed Oct 25, 2017 2:19 pm)
User avatar
Pedro
 
Posts: 578
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 41 times

Re: How to fetch only package name from the report

Postby dhana venkatesh » Wed Oct 25, 2017 2:20 pm

Thanks Nic,Enricho and Pedro. I got the expected result by use of rexx.
dhana venkatesh
 
Posts: 31
Joined: Thu Mar 06, 2014 6:53 pm
Has thanked: 3 times
Been thanked: 0 time

Previous

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post