How to Display a VPS Printer definition

IBM's Command List programming language & Restructured Extended Executor

How to Display a VPS Printer definition

Postby Fabrice Lubela » Tue Jun 02, 2015 12:23 am

I have two datasets I ‘m working with. In the first one, FL1T.LRS.VPSFCB.CNTL , I have a member containing all printers name on the network, for example PEAU01. In the second dataset, FL1T.LRS.VPSFCB.PRINTERS, each members is a definition of a printer, for example member PEAU01 have the definitions for this particular printer(TCPHOST=DCNCSRVRMSP01.AAA.COM, TCPLPORT=(10001-10500), TCPPRTR=ISTXIP687) in multiple lines. My work is to display only the TCPHOST and TCPPRTR. Any idea on how to do it? I already wrote a piece of code to get the printers names but I am missing how to go to second dataset and retrieve the line that contains those information. Below is what I’ve done so far.
 000001 /* REXX */                                                 
 000002 Parse Arg Dsplay                                           
 000003 /*********************************************************/
 000004 /* Loop through the input file to get printer names.     */
 000005 /*********************************************************/
 000006  trace o                                                   
 000009  "FREE FILE(INPUTZ)"                                       
 000011 DO X = 1 TO MYVAR.0
 000012     LINE_IN = MYVAR.x                                       
 000013     IF index(LINE_IN,'*') = 1 then iterate                 
 000014     Parse VAR line_in Pname Da1 Da2 Da3 Da4 Da5 Da6 Da7 Da8
 000015     CALL Subroutine                                         
 000016 END                                                         
 000018 Exit
 000019 SUBROUTINE :                                                   
 000020 Pname = STRIP(PNAME,,',')                                     
 000022 q = "'"                                                       
 000023 dsname1  = q ||'FL1T.LRS.VPSFCB.PRINTERS(' || pname || ')' || q
 000025 "ALLOC DA(" || DSNAME1 ||" ) F(INPUTY) SHR"                   
 000027 "free file(INPUTY)"                                           
 000028 SAY 'PFound= ' PNAME 
000029 RETURN

You do not have the required permissions to view the files attached to this post.
Fabrice Lubela
Posts: 8
Joined: Wed May 27, 2015 9:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to Display a VPS Printer definition


Re: How to Display a VPS Printer definition

Postby prino » Tue Jun 02, 2015 2:37 am

Why the flipping 'ell do you attach a docx file, a screwed up XML format, designed by a convicted monopolist that can only be read by very expensive software?

What's wrong with plain text?
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
Posts: 470
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 19 times

Re: How to Display a VPS Printer definition

Postby NicC » Tue Jun 02, 2015 2:26 pm

Please use the code tags to preserve spacing when entering code and data etc.

Why assign myvar.x to line_in? Why not use the stem variable directly?

What problem are you having getting the data fronm the second dataset? Can you not simply find where the string starts, find the next comma and then substr the string out?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Global moderator
Posts: 2515
Joined: Sun Jul 04, 2010 12:13 am
Location: Down on the pig farm
Has thanked: 4 times
Been thanked: 86 times

Return to CLIST & REXX


  • Related topics
    Last post