|
View previous topic :: View next topic
|
| Author |
Message |
razesh84
New User
Joined: 05 Apr 2010 Posts: 41 Location: Kolkata,India
|
|
|
|
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 |
|
 |
THINKSRINIII Warnings : 1 New User
.jpg)
Joined: 09 Jan 2009 Posts: 88 Location: India
|
|
|
|
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 |
|
 |
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
razesh84
New User
Joined: 05 Apr 2010 Posts: 41 Location: Kolkata,India
|
|
|
|
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  |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
razesh84
New User
Joined: 05 Apr 2010 Posts: 41 Location: Kolkata,India
|
|
|
|
thanks Frank  |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|