Hi Jay,
Try this code. It passes a buffer instead of a permanent file ...
#########################################################
::
::Setvar Fy_Continue , True
::Setvar Fy_Total , 0
::Setvar Fy_Years , ""
::
::While !Fy_Continue Do
:: Setvar Fy_In,""
:: Echo
:: Input Fy_In , "## Enter Fiscal Year (YY) or (Return to Exit): "
:: If Fy_In = "" Then
:: Setvar Fy_Continue , False
:: Else
:: If Numeric('!Fy_In') and Len('!Fy_In') = 2 Then
:: Setvar Fy_Total , Fy_Total + 1
:: Setvar Fy_Years , "!Fy_Years" + "!Fy_In"
:: Else
:: Echo
:: Echo ## Invalid Year enterted ...
:: Endif
:: Endif
::Endwhile
::
::Echo
::
!Job Test,Mgr.Test
!
!Setvar Fy_Total , {Fy_Total}
!Setvar Fy_Years , "{Fy_Years}" + " "
!
!Setvar Fy_Count , 1
!Setvar Fy_Pos , -1
!
!While Fy_Count <= Fy_Total Do
!
! Setvar Fy_Pos , Fy_Pos + 2
! Setvar Year , Str('!Fy_Years',!Fy_Pos,2)
!
! Echo I File!Year > SuptCmds
! Echo O FileAll,Append >> SuptCmds
! Echo E >> SuptCmds
!
! Print SuptCmds
!
!### Run SuprTool.Pub.Robelle;Parm=4;Info="Use SuptCmds"
!
! Setvar Fy_Count , Fy_Count + 1
!
!EndWhile
!
!Eoj
#########################################################
Rob.
-----Original Message-----
From: HP-3000 Systems Discussion [mailto:[log in to unmask]] On Behalf
Of Jay Willis
Sent: Friday, August 19, 2005 8:22 AM
To: [log in to unmask]
Subject: Re: Need Suprtool to read a fileset
Thanks for the assistance, Olav. The first part of the job prompts the
user for a year value (01,02,...). When the user has entered all the
years they want to report on, they would end the prompt loop with double
slashes (//). Here's the code:
::SETVAR PMMSS, "P" + STR("!HPDATETIME",11,4)
::BUILD !PMMSS.NOBACKUP;REC=-40,,F,ASCII
::FILE X = !PMMSS.NOBACKUP,OLD;ACC=APPEND
::ECHO *******************************************************
::ECHO * For each year: *
::ECHO * Type the year, then hit the INSIDE enter key. *
::ECHO * After you've typed the last year and hit return, *
::ECHO * type '//" and hit return. *
::ECHO *******************************************************
::ECHO
::PROMPT STRING FY = "Fiscal Year (YY)....................."
:: IF NOT FINFO("FILE{FY}",0) THEN
:: ECHO
:: ECHO *********************************************
:: ECHO The file for fiscal year !FY does not exist!
:: ECHO Re-submit job with a valid year.
:: ECHO *********************************************
:: ECHO
:: EXIT
:: ELSE
:: ASSIGN PVF = "FILE{FY}"
:: ENDIF
::ECHO FILE{FY} > *X
::WHILE FY<>"//"
:: PROMPT STRING FY = " "
:: ECHO FILE{FY} >> *X
::ENDWHILE
The file {PMMSS} - I'm using the minute and seconds of HPDATETIME as
part of the file's name to make it unique so that another user can't
come along and overwrite the file - contains the name of the files that
the user wants to report on.
The problem I have now is how to have Suprtool process each one of the
files that are listed within the {PMMSS} file. I'm fairly certain that I
need for Suprtool to go through a while...endwhile loop until each of
the files has been processed. Just don't know how to go about it.
Jay
-----Original Message-----
From: Olav Kappert [mailto:[log in to unmask]]
Sent: Thursday, August 18, 2005 7:01 PM
To: Jay Willis
Cc: [log in to unmask]
Subject: Re: Need Suprtool to read a fileset
Jay:
Write a script that asks for the year and append the input to the
default file name and make a file equation to it.
In suprtool input the the redefined file and do what you need to do in
suprtool while appending the qualified extraction date to a file defined
in append mode..
Do the same for each inputted year.
Olav.
Jay Willis wrote:
>Greetings,
>
>I'm stumped and need some help. We have a set of files whose names end
>with a 2-digit year - FILE98, FILE99, FILE00, FILE01... In a Streamx
>job the user is prompted for one or more years, corresponding to the
>file(s) he/she needs a report of. I am using a while...endwhile loop to
>prompt for year values. These 2-digit years are appended to a file that
>would be read by Suprtool. If the user wants a report of data, for
>instance, from files
>FILE02 and FILE04, then the appended file would look like this:
>
>/LIST YEARFILE
>02
>04
>
>In another while loop (within the same job) I was envisioning Suprtool
>reading each file (FILE02 and FILE04) and extracting data appropriate
>to the report being requested.
>
>If somehow you can understand the problem as I've presented it, and can
>offer some help I'd be very grateful.
>
>Jay
>
>* To join/leave the list, search archives, change list settings, *
>* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
>
>
>
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|