Page 1 of 1

How to Display a VPS Printer definition

PostPosted: Tue Jun 02, 2015 12:23 am
by Fabrice Lubela
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                                                   
 000007 "ALLOC DA('FL1T.LRS.VPSFCB.CNTL(VPSMLIS2)') F(INPUTZ) SHR"
 000008 ADDRESS MVS "EXECIO * DISKR INPUTz (FINIS STEM MYVAR."     
 000009  "FREE FILE(INPUTZ)"                                       
 000010                                                           
 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                                                         
 000017                                                             
 000018 Exit
 000019 SUBROUTINE :                                                   
 000020 Pname = STRIP(PNAME,,',')                                     
 000021                                                               
 000022 q = "'"                                                       
 000023 dsname1  = q ||'FL1T.LRS.VPSFCB.PRINTERS(' || pname || ')' || q
 000024                                                               
 000025 "ALLOC DA(" || DSNAME1 ||" ) F(INPUTY) SHR"                   
 000026                                                               
 000027 "free file(INPUTY)"                                           
 000028 SAY 'PFound= ' PNAME 
000029 RETURN

Doc2.docx

Re: How to Display a VPS Printer definition

PostPosted: Tue Jun 02, 2015 2:37 am
by prino
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?

Re: How to Display a VPS Printer definition

PostPosted: Tue Jun 02, 2015 2:26 pm
by NicC
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?