|
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. -- [ Picked text/plain from multipart/alternative ] -----Original Message----- From: Weatherly, Howard Sent: Wednesday, August 07, 2002 2:13 PM To: Midrange Mailing List (E-mail) Subject: Re: Any way to pull data from a spool file Brian, This might help, first create a file in some library with a length of 132, then you can wrap the CPYSPLF command in a cl (If you have TAATOOLS, you can also use the RTVSPLFID command to get the info for the CPYSPLF command). Once you have the Spoolfile copied, you can do anything you want because it is now a data file. This is a chunk of code that is extracting the job name from the HASP banner page of a report from a mainframe. It just happens that the banner has title that can be used as handles to find the data. You can apply this code in some for to find anything in a report as long as you know some of the characteristics and that characteristic is unique. Hope this helps. 1 JUNK PIC X(10). 1 JUNK1 PIC X(10). 1 REPORTNAME PIC X(10). 1 JOBID PIC X(10). 1 USERID PIC X(10). 1 USER PIC X(20). 1 PRINTTIME PIC X(10). 1 PRINTDATE PIC X(11). 1 WS-PTR Comp PIC 9(04) Value 1. 1 WS-PARM1 PIC X(10). 1 WS-PARM2 PIC X(10). 1 WS-PARM3 PIC X(10). 1 WS-PARM4 PIC X(10). 1 WS-PARM5 PIC X(10). 1 WS-PARM6 PIC X(11). 1 WS-PARM9 PIC X(20). 1 WS-ERROR PIC X(01). Exec SQL Begin Declare Section End-Exec. 1 ARC PIC X(10). 1 JOB PIC X(10). 1 RPT PIC X(10). 1 USR PIC X(10). 1 TIM PIC X(10). 1 DAT PIC X(11). 1 NAM PIC X(20). 1 REPORT-FLD PIC X(1000). 1 WS-STMT. 49 STMT-LEN Comp-4 PIC S9(04) Value +130. 49 STMT-TEXT PIC X(130). Exec SQL End Declare Section End-Exec. Exec SQL Declare C6 Cursor For S1 End-Exec 2000-Get-REPORTNAME. MOVE 1 TO WS-PTR MOVE +100 TO STMT-LEN INITIALIZE REPORT-FLD REPORTNAME JOBID STMT-TEXT WS-ERROR String "SELECT MAX(WATCH) FROM R2WSEARCH." LS-PARM1 " Where WATCH like ~%JOB NAME%~" DELIMITED BY SIZE INTO STMT-TEXT WITH POINTER WS-PTR END-STRING INSPECT STMT-TEXT REPLACING ALL "~" BY QUOTE Exec SQL PREPARE S1 From :WS-STMT End-Exec Evaluate SQLCODE When 0 Exec SQL OPEN C6 End-Exec Evaluate SQLCODE When 0 Exec SQL FETCH C6 INTO :REPORT-FLD End-Exec IF SQLCODE = -305 MOVE "E" TO WS-ERROR MOVE "ERROR" to REPORTNAME END-IF Exec SQL CLOSE C6 End-Exec If SQLCODE = -901 Display "Close C6" End-If When -901 Move "X" to WS-ERROR MOVE "ERROR" to REPORTNAME When other MOVE "E" TO WS-ERROR MOVE "ERROR" to REPORTNAME End-Evaluate When -901 MOVE "W" TO WS-ERROR When Other MOVE "E" TO WS-ERROR MOVE "ERROR" to REPORTNAME End-Evaluate IF WS-ERROR = " " UNSTRING REPORT-FLD Delimited by "JOB NAME: " into JUNK1 REPORTNAME End-UNSTRING Move REPORTNAME to WS-PARM2 Else Continue END-IF . 2000-EXIT. EXIT. ____________________________________________ Howard Weatherly Systems Advisor Computer Task Group, Inc. howard.weatherly@dlis.dla.mil Howard_weatherly@ameritch.net Howard.Weatherly@ctg.com "luck favors those who prepare"
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.