Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Add Field From Report Header to Each Detail Line

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Wed Jul 25, 2007 7:25 pm    Post subject: Add Field From Report Header to Each Detail Line
Reply with quote

Hey, it's my turn for one!

The input dataset is a report, RECFM=FBA, LRECL=133. The output dataset is a QSAM dataset, RECFM=FB, LRECL=119.

I need to insert the date from the page's header line into each of the detail lines for that page.

Sample input:

Code:

1COMPUTER ASSOCIATES                 MAILBOX     REPORT                 PAGE  343
 TIME     SCHEDULE JOB NAME JNO ST MNO USERID   SSID MESSAGES ISSUED ON 07/23/07
 23.58.43 TRNSFR01 P1130TFX  01 40 060          SCD1 COMPLETED AT 23.58.43  CODE:00000 AT MVSJESD  ON SYSD
 23.58.46 SWAT001  P5000SWD  01 40 060          SCD1 COMPLETED AT 23.58.46  CODE:00000 AT MVSJESD  ON SYSD
 23.58.46 SWAT001  P5010SWD  01 40 069          SCD1 JOB STARTED AT 23.58.46 AT MVSJESD  ON SYSD

1COMPUTER ASSOCIATES                 MAILBOX     REPORT                 PAGE  344
 TIME     SCHEDULE JOB NAME JNO ST MNO USERID   SSID MESSAGES ISSUED ON 07/24/07
 00.00.00 NEWISSUE P5330PTD  01 40 069          SCD1 JOB STARTED AT  0.00.00 AT MVSJESD  ON SYSD
 00.00.07 NEWISSUE P5330PTD  01 40 060          SCD1 COMPLETED AT  0.00.07  CODE:00001 AT MVSJESD  ON SYSD
 00.00.08 NEWISSUE P5340PTD  01 40 069          SCD1 JOB STARTED AT  0.00.08 AT MVSJESD  ON SYSD


Sample output:

Code:

235843 20070723 TRNSFR01 P1130TFX SCD1 COMPLETED AT 23.58.43  CODE:00000 AT MVSJESD  ON SYSD
235846 20070723 SWAT001  P5000SWD SCD1 COMPLETED AT 23.58.46  CODE:00000 AT MVSJESD  ON SYSD
235846 20070723 SWAT001  P5010SWD SCD1 JOB STARTED AT 23.58.46 AT MVSJESD  ON SYSD
...
000000 20070724 NEWISSUE P5330PTD SCD1 JOB STARTED AT  0.00.00 AT MVSJESD  ON SYSD
000007 20070724 NEWISSUE P5330PTD SCD1 COMPLETED AT  0.00.07  CODE:00001 AT MVSJESD  ON SYSD


which is:

Time Value from columns 2-9 with the decimal point removed.
Date Value from the header line "MESSAGES ISSUED ON mm/dd/yy" in yyyymmdd format.
Columns 19-27 asis.
Columns 49-133 asis.
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: Wed Jul 25, 2007 10:23 pm    Post subject:
Reply with quote

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 (FBA/133)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD RECFM=FB,DSN=...  output file (FB/120)
//TOOLIN   DD    *
COPY FROM(IN) TO(T1) USING(CTL1)
SPLICE FROM(T1) TO(OUT) ON(121,8,ZD) -
  WITHALL WITH(1,7) WITH(16,105) USING(CTL2)
/*
//CTL1CNTL DD *
  OMIT COND=(1,9,CH,EQ,C'1COMPUTER',OR,1,9,CH,EQ,C' ')
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(134:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(2,4,CH,EQ,C'TIME'),
                OVERLAY=(134:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=NONE,
                OVERLAY=(142:SEQNUM,8,ZD,
                         134:134,8,ZD,SUB,142,8,ZD,M11,LENGTH=8))
  OUTREC IFTHEN=(WHEN=(2,4,CH,EQ,C'TIME'),
          BUILD=(8:C'20',79,2,73,2,76,2,121:134,8)),
         IFTHEN=(WHEN=NONE,
          BUILD=(2,8,UFF,EDIT=(TTTTTT),
            17:11,17,35:49,85,121:134,8))
/*
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Fri Aug 03, 2007 8:35 pm    Post subject: Re: Add Field From Report Header to Each Detail Line
Reply with quote

I think my original follow-up post got lost.

Thanks, that code was exactly what I was looking for. I was getting hung up on how to create the splicing key with the sequence numbers. This one is definitely getting filed away into my personal "tricks" library.
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 Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Report cost in CA-dispatch Nileshkul CA Products 3 Wed Jun 07, 2017 10:32 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us