Page 2 of 2

Re: How to fetch only package name from the report

PostPosted: Fri Jul 21, 2017 4:17 pm
by dhana venkatesh
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

Re: How to fetch only package name from the report

PostPosted: Fri Jul 21, 2017 5:01 pm
by NicC
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.

Re: How to fetch only package name from the report

PostPosted: Fri Jul 21, 2017 9:23 pm
by dhana venkatesh
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

Re: How to fetch only package name from the report

PostPosted: Sat Jul 22, 2017 12:03 pm
by NicC
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.

Re: How to fetch only package name from the report

PostPosted: Sat Jul 22, 2017 6:09 pm
by enrico-sorichetti
there is just one little problem ...
how to identify the line(s) which contain a valid(*) package name

(*) valid as satisfying the TS requirement

Re: How to fetch only package name from the report

PostPosted: Thu Jul 27, 2017 3:25 am
by Pedro
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.

Re: How to fetch only package name from the report

PostPosted: Wed Oct 25, 2017 2:20 pm
by dhana venkatesh
Thanks Nic,Enricho and Pedro. I got the expected result by use of rexx.