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

Stripping a block of record from the file


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

New User


Joined: 05 Apr 2010
Posts: 41
Location: Kolkata,India

PostPosted: Sun Jun 20, 2010 1:45 pm
Reply with quote

I've a flat file which is basically job logs for a given day. I need to develop a tool which takes the jobname as an input & pulls that particular job log from the file.The i/p file looks like..........

Code:
J E S 2 J O B L O G -- S Y S T E M X B O C -- N O D E
16.00.49 JOB06098 IEF196I BOC987I JOB=KEYADATE STP=ZEKECTL RC=NXEQ
16.00.49 JOB06098 IEF196I BOC987I JOB=KEYADATE STP=KEYA010 RC=0000
* STEP ZEKECTL PROGRAM IEFBR14 REGION USED 0K CPU TIME 00:00:00
* STEP KEYA010 PROGRAM KEY0DATE REGION USED 668K CPU TIME 00:00:00
J E S 2 J O B L O G -- S Y S T E M E B O C -- N O D E
13.00.40 JOB55270 IEF196I BOC987I JOB=KEYBDATE STP=ZEKECTL RC=NXEQ
13.00.40 JOB55270 IEF196I BOC987I JOB=KEYBDATE STP=KEYB010 RC=0000
* STEP ZEKECTL PROGRAM IEFBR14 REGION USED 0K CPU TIME 00:00:00
* STEP KEYB010 PROGRAM KEY0DATE REGION USED 664K CPU TIME 00:00:00
J E S 2 J O B L O G -- S Y S T E M E B O C -- N O D E


my o/p file should have

Code:
J E S 2 J O B L O G -- S Y S T E M X B O C -- N O D E
16.00.49 JOB06098 IEF196I BOC987I JOB=KEYADATE STP=ZEKECTL RC=NXEQ
16.00.49 JOB06098 IEF196I BOC987I JOB=KEYADATE STP=KEYA010 RC=0000
* STEP ZEKECTL PROGRAM IEFBR14 REGION USED 0K CPU TIME 00:00:00
* STEP KEYA010 PROGRAM KEY0DATE REGION USED 668K CPU TIME 00:00:00


considering KEYADATE is given as job name
Back to top
View user's profile Send private message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Mon Jun 21, 2010 8:05 am
Reply with quote

Hi,

This job will do what you required. I have assumed both input and output files to be LERCL 90 FB


Code:

 SORT FIELDS=COPY                                           
 INREC IFTHEN=(WHEN=GROUP,BEGIN=(39,8,CH,EQ,C'KEYADATE'),   
               END=(1,7,CH,EQ,C'J E S 2'),PUSH=(430:39,8))   
 OUTFIL BUILD=(1,90),INCLUDE=(430,1,CH,EQ,C'KEYADATE')       


Although there may be better ways of doing it!
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Mon Jun 21, 2010 8:12 pm
Reply with quote

THINKSRINIII,
How do you explain your INCLUDE statement?

Code:
INCLUDE=(430,1,CH,EQ,C'KEYADATE')


An 8 byte field comparison with 1 byte?

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: Mon Jun 21, 2010 11:26 pm
Reply with quote

THINKSRINIII's job also won't have the J E S record first. (Please test your job's before posting them.)

razesh84,

What exactly do you mean by

Quote:
I need to develop a tool which takes the jobname as an input


How do you want to pass the jobname - hardcoded? as a DFSORT symbol? from another file? or what?

What is the RECFM and LRECL of your input file?

Does 'JOB=jobname' always appear in the second record of the group? Does'JOB=' always start in the same position? If so, what position is that?
Back to top
View user's profile Send private message
razesh84

New User


Joined: 05 Apr 2010
Posts: 41
Location: Kolkata,India

PostPosted: Tue Jun 22, 2010 10:58 pm
Reply with quote

thanks THINKSRINIII

your card worked good with a little change in INCLUDE statement,though the JES record appeared in the last.For the time being i moved this record to 1st position in the file manually.

Frank,

I planned to pass the jobname through SYSIN.I dont have any idea about the others ways.Anykind of help regarding this is appreciable.Sorry for the confusion.

Quote:
What is the RECFM and LRECL of your input file?

My input file is fixed block 140 length.

Quote:
Does 'JOB=jobname' always appear in the second record of the group?

Yes 2nd record of every group sud have this string.If a job has five steps then the 1st record will be the JES & 2,3,4,5,6 records will have the 'JOB=jobname' string but with different stepname.

Quote:
Does'JOB=' always start in the same position? If so, what position is that?

yes it starts in 35th position.

please let me know if any other details are required.
This was my post in the forum & thanks all for the help icon_biggrin.gif
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 22, 2010 11:33 pm
Reply with quote

razesh84,

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file (FB/140)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CTL2CNTL DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/140)
//TOOLIN DD *
COPY FROM(IN) TO(CTL2CNTL) USING(CTL1)
COPY FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,7,CH,EQ,C'J E S 2'),
    PUSH=(141:ID=8,149:SEQ=8))
  OUTFIL FNAMES=T1
  OUTFIL INCLUDE=(149,8,ZD,EQ,2,AND,
    39,8,CH,EQ,C'KEYADATE'),   <------------ jobname
    BUILD=(C'  INCLUDE COND=(141,8,ZD,EQ,',141,8,C')',80:X,/,
    C'  OUTREC BUILD=(1,140) ')
/*
Back to top
View user's profile Send private message
razesh84

New User


Joined: 05 Apr 2010
Posts: 41
Location: Kolkata,India

PostPosted: Thu Jun 24, 2010 10:19 pm
Reply with quote

thanks Frank icon_smile.gif
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 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
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top