- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: DIsplaying a table
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2006 03:07 AM
тАО03-14-2006 03:07 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2006 03:13 AM
тАО03-14-2006 03:13 AM
Re: DIsplaying a table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2006 03:19 AM
тАО03-14-2006 03:19 AM
Re: DIsplaying a table
to begin with:
Welcome to the VMS forum!
I am not sure if I understand your question correct.
Is your attachment showing your .RPT file proper? In other words, do you just need a reformatting program? If not, can you post a .RPT file?
If the top halve of your post _IS_ the .RPT, then a simple DCL will be all you need (and I am sure Hein will show up with a perl solution).
Please supply more info.
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2006 03:22 AM
тАО03-14-2006 03:22 AM
Re: DIsplaying a table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2006 03:56 AM
тАО03-14-2006 03:56 AM
Solutionfwiw... Your questions are close enough, that they would have best been left as a single topic IMHO.
Do you have any (DCL) starting point already?
Your first question is pretty tricky. Not hard hard, but probably a fair amount of work. If you insist on using DCL, then I'd suggest check out F$FAO. This is not the easiest lexical function to get going, but it is the best/only way to get clean formatting.
I would recommend PERL for text processing challenges like this one. DCL can do it, but it'll be tedious.
But anyway, I like the current question/direction better.
Why not list all 'happy' nodes at the bottom, and give problematic systems the full line space they deserve?!
Here is a sample script to get you going on that:
$ type x.com
$OPEN/READ in 'p1
$header = "Node Name ="
$clear = ""
$header_length = F$LEN(header)
$loop:
$READ/end=done in record
$IF F$EXTR(0,header_length,record).EQS.header
$THEN
$node = F$EXTR(header_length,99,record)
$READ in record
$IF F$LOC(":-)",record).NE.F$LEN(record)
$THEN
$clear = clear + node
$ELSE
$WRITE SYS$OUTPUT header, node
$WRITE SYS$OUTPUT record
$ENDIF
$ELSE
$WRITE SYS$OUTPUT record
$ENDIF
$GOTO loop
$done:
$WRITE SYS$OUTPUT ""
$WRITE SYS$OUTPUT "These computers are all clear: ", clear
$CLOSE in
$
And here is sample output for that script:
$ @x x.tmp
Node Name = OWS2
This computer still contains data of types a, b, & c.
Node Name = OWS3
This computer still contains data of type c.
These computers are all clear: OWS1 OWS4
Hope this helps,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2006 03:58 AM
тАО03-14-2006 03:58 AM
Re: DIsplaying a table
so, your MAIN issue is getting them on one screen?
My quickest take would be to append the data concerning a node on the node ID line.
Here is a try:
$ OPEN /READ IFI
$ OPEN/WRITE OFI
$LOOP:
$ READ IFI REC/END=DONE
$ REC = F$EDIT(REC,"TRIM"")
$ IF REC .EQS. "" THEN GOTO LOOP
$ IF F$ELEMENT(0," ",REC) .EQS. "Node"
$ THEN
$ LINE = F$FAO("!20AS",REC)
$ GOTO LOOP
$ ENDIF
$! data line:
$ LINE = LINE + REC
$ WRITE OFI LINE
$ GOTO LOOP
$
$DONE:
$ CLOSE IFI
$ CLOSE OFI
$ TYPE
$! Cleanup or save, as needed.
DISCLAIMER: UNtested!
Of course, you WILL get a pretty loaded screen, but that is what you asked for!.
Success.
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2006 05:05 AM
тАО03-14-2006 05:05 AM
Re: DIsplaying a table
Do you want to modify the program that generates the report or do you need to create a new program that reformats the output before it's displayed?
It would be easier if you can modify the generating program.
The current report has too much redundant text:
Node Name = OWS1
This computer is all clear :-)
Node Name = OWS2
This computer still contains data of types a, b, & c.
Node Name = OWS3
This computer still contains data of type c.
You know it's the node name. Just display it.
You know it's a computer. You really only want to know the status. So all you need is:
OWS1 clear
OWS2 a,b,c
OWS3 c
Write a title like "Node Status" at the top.
Now, loop to build your display line with as many nodes "up" as you want (5 max will fit).
Why not just display the "not-clear" nodes if those are the ones you're concerned with? Then at the end display count totals for clear & un-unclear nodes.
It's just programming.
-Doug
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2006 05:16 AM
тАО03-14-2006 05:16 AM
Re: DIsplaying a table
This sounds like a good plan but I still need the output to be in preferrably 3 columns so that all results can be seen on one screen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2006 08:05 AM
тАО03-14-2006 08:05 AM
Re: DIsplaying a table
$ HELP LEX F$FAO
While it seems complicated at first, the examples should show you how you can format the display line.
To process the .rpt file you have (q&d, not tested):
$!...do housekeeping stuff
$ open/read rpt filename.rpt
$!...
$loop1:
$ c1 = ""
$ c2 = ""
$ c3 = ""
$ cnt = 0
$!
$loop2:
$ read/end=finish rpt inrec
$ if f$extract(0,4,inrec) .eqs. "Node"
$ then
$ cnt = cnt + 1
$ nodex = inrec - "Node Name = "
$ read/end=error1 rpt inrec
$ if f$extract(0,4,inrec) .eqs. "This"
$ then
$ statusx = inrec - "This computer" -
- "is all " - " :-)" -
- "still contains data of type" -
- "s" - "& "
$ c'cnt' = f$fao("!6AS!10AS",nodex,statusx)
$ else
$ goto error1 !missing record
$ endif
$ goto loop2 !skip blank lines
$ endif
$!
$ if cnt .lt. 3 then goto loop2
$ call showit
$ goto loop1
$finish:
$ if cnt then call showit
$! display whatever eoj data you want.
$ write sys$output ""
$ read/prompt="Press ENTER " sys$command inp
$ goto quit
$error1:
$! incorrect or missing report record,
$! display error message and ask for ack.
$quit:
$ close rpt
$ exit
$!
$showit: subroutine
$ write sys$output -
f$fao(" !#(20AS)",cnt,c1,c2,c3)
$exit
$endsubroutine
You could test statusx .eqs. "clear" and increment a count which you display at the end instead of loading clear into column.
Please forgive any typo's. I haven't really tested this code ('cause I don't have your file;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2006 09:40 AM
тАО03-14-2006 09:40 AM
Re: DIsplaying a table
I had a couple of minutes to test the q&d code against your 4 examples and made a couple of revisions. See attachment. The code is between the $!----<>---- lines. You'll need to add error testing & change the filename.rpt to whatever you need & polish it up some.
-Doug