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
 

 

Stripping a block of record from the file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Stripping a block of record from the file
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    Post subject: Reply to: Stripping a block of record from the file
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: 578
Location: USA

PostPosted: Mon Jun 21, 2010 8:12 pm    Post subject:
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 Moderator


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

PostPosted: Mon Jun 21, 2010 11:26 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Jun 22, 2010 11:33 pm    Post subject:
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    Post subject:
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    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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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