IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Retaining info from an input file.....Question


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
haleyja

New User


Joined: 09 Mar 2006
Posts: 15

PostPosted: Mon Jun 12, 2006 9:09 pm
Reply with quote

Is it possible to extract info from a file and retain it in a variable if thats possible in the new sort... and only change it at the next occurance of the found data.... example I have a file of all run JCL jobs. I want to pull out info and create a new output record with say the Job name and Program
name and elapsed time. and put them on one record.

The new record would like this
Job PX92RFBD PROGRAM NAME: ICEGENER START DATE : 06.161 ELAPSED TIME: 00:00:00.33

Example Input
MVS/ESA SP7.0.4 PRDS*********JOB PX92RFBD***********

JES2 JOB ID : JOB01616 START DATE : 06.161
JOB CLASS : B START TIME : 02:18:20.11
STEP NAME : STEP03 END DATE : 06.161
STEP NUMBER : 0005 END TIME : 02:18:20.44
PROGRAM NAME: ICEGENER ELAPSED TIME: 00:00:00.33


Is this possible and easy with the new sort features or can it be done with icetool?

Thanks for your help.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Jun 12, 2006 9:44 pm
Reply with quote

I'm not sure I understand what you're asking.

You can create the one record you want using the new (April, 2006) INREC with SPLICE feature of DFSORT.

But I don't know what you mean by
Quote:
Is it possible to extract info from a file and retain it in a variable if thats possible in the new sort... and only change it at the next occurance of the found data....


Please try to explain more clearly what it is exactly that you want to do.
Back to top
View user's profile Send private message
haleyja

New User


Joined: 09 Mar 2006
Posts: 15

PostPosted: Mon Jun 12, 2006 10:52 pm
Reply with quote

Frank,

Don't know if I can explain it correctly. I have a large input file with many jobs containing the Jes run info. Like jobname and elapsed time excetera.
All this info is on different lines and I want to extract the info to create a second file with extracted data for each job. One record per job. So esentially id be creating a flat file database. Which could be used for other purposes.

I hope that makes sense. Do you have an example of this splice feature if that is what I need.

Thanks
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jun 13, 2006 12:32 am
Reply with quote

Assuming that the identifying keywords in your records are at fixed positions, you can use a DFSORT/ICETOOL job like the following to do what you asked for. You'll need the April, 2006 DFSORT PTF to use INREC with SPLICE.

Code:

//S1    EXEC PGM=ICETOOL                                           
//TOOLMSG   DD SYSOUT=*                                           
//DFSMSG    DD SYSOUT=*                                           
//IN  DD DSN=&&IN,DISP=(OLD,PASS)                                 
//OUT DD SYSOUT=*                                                 
//TOOLIN DD *                                                     
 SPLICE FROM(IN) TO(OUT) ON(82,8,ZD) -                             
   WITHEACH WITH(14,19) WITH(34,48) USING(CTL1)                   
//CTL1CNTL DD *                                                   
  INCLUDE COND=(26,8,CH,EQ,C'****JOB ',OR,                         
            1,13,CH,EQ,C'PROGRAM NAME:',OR,                       
            1,13,CH,EQ,C'JES2 JOB ID :')                           
  INREC IFOUTLEN=89,                                               
        IFTHEN=(WHEN=INIT,OVERLAY=(82:SEQNUM,8,ZD)),               
        IFTHEN=(WHEN=(26,8,CH,EQ,C'****JOB '),                     
           BUILD=(1:30,12,82:SEQNUM,8,ZD)),                       
        IFTHEN=(WHEN=(1,13,CH,EQ,C'JES2 JOB ID :',OR,             
                      1,13,CH,EQ,C'PROGRAM NAME:'),               
           OVERLAY=(90:SEQNUM,8,ZD,                               
                    82:82,8,ZD,SUB,90,8,ZD,M11,LENGTH=8),         
             HIT=NEXT),                                           
        IFTHEN=(WHEN=(1,13,CH,EQ,C'JES2 JOB ID :'),               
           BUILD=(14:24,19,82:82,8)),                             
        IFTHEN=(WHEN=(1,13,CH,EQ,C'PROGRAM NAME:'),               
           BUILD=(34:1,48,82:82,8))                               
  OUTFIL FNAMES=OUT,                                               
    BUILD=(1,13,14:34,23,37:14,20,57:57,25)                       
/*                                                                 


As an example, if IN had:

Code:

MVS/ESA SP7.0.4 PRDS*********JOB PX92RFBD***********               
                                                                   
JES2 JOB ID : JOB01616 START DATE : 06.161                         
JOB CLASS : B START TIME : 02:18:20.11                             
STEP NAME : STEP03 END DATE : 06.161                               
STEP NUMBER : 0005 END TIME : 02:18:20.44                           
PROGRAM NAME: ICEGENER ELAPSED TIME: 00:00:00.33                   
                                                                   
MVS/ESA SP7.0.4 PRDS*********JOB PQR52183***********               
                                                                   
JES2 JOB ID : JOB01617 START DATE : 06.162                         
JOB CLASS : B START TIME : 02:50:32.01                             
STEP NAME : STEP03 END DATE : 06.162                               
STEP NUMBER : 0005 END TIME : 03:52:32.12                           
PROGRAM NAME: ICEMAN   ELAPSED TIME: 01:02:00.11                   


OUT would have:

Code:

JOB PX92RFBD PROGRAM NAME: ICEGENER START DATE : 06.161 ELAPSED TIME: 00:00:00.33
JOB PQR52183 PROGRAM NAME: ICEMAN   START DATE : 06.162 ELAPSED TIME: 01:02:00.11
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top