Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Retaining info from an input file.....Question
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 Moderator


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

PostPosted: Mon Jun 12, 2006 9:44 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Jun 13, 2006 12:32 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us