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
 
Converting multiple Headers and Trailers into one

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

New User


Joined: 10 Jul 2008
Posts: 4
Location: Hyderabad

PostPosted: Thu Jul 10, 2008 4:23 pm    Post subject: Converting multiple Headers and Trailers into one
Reply with quote

Hello,

I have data merged from two files like this

H0012008-07-012008-07-31
DDATA RECORD ONE
DDATA RECORD TWO
DDATE RECORD THREE
TTRAILER RECORD FOR FIRST FILE COUNT OF DATA RECORDS 00003
H0022008-07-01200807-31
DDATA RECORD FOUR
DDATA RECORD FIVE
DDATA RECORD SIX
DDATA RECORD SEVEN
TTRAILER RECORD FOR SECOND FILE COUNT OF DATA RECORDS 00004


In my output file I need one header (does not matter which one it is)
I need all the data records
I need one trailer(does not matter which one) with the count of total data records.
Effectively I need my output file some thing like this

H0012008-07-012008-07-31
DDATA RECORD ONE
DDATA RECORD TWO
DDATE RECORD THREE
DDATA RECORD FOUR
DDATA RECORD FIVE
DDATA RECORD SIX
DDATA RECORD SEVEN
TTRAILER RECORD FOR SECOND FILE COUNT OF DATA RECORDS 00007

First byte of the file would have 'H'eader, 'D'ata or 'T'railer
It is going to be a FB file of length 80. Count of records would come in trailer record from 73 through 80.

COuld this be accomplished through DFSORT? If so, kindly help.

Thanks,
Chandra


icon_question.gif
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jul 10, 2008 9:19 pm    Post subject:
Reply with quote

chandra_devatha,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICEMAN                                   
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                             
H0012008-07-012008-07-31                                     
DDATA RECORD ONE                                             
DDATA RECORD TWO                                             
DDATE RECORD THREE                                           
TTRAILER RECORD FOR FIRST FILE COUNT OF DATA RECORDS 00003   
H0022008-07-01200807-31                                     
DDATA RECORD FOUR                                           
DDATA RECORD FIVE                                           
DDATA RECORD SIX                                             
DDATA RECORD SEVEN                                           
TTRAILER RECORD FOR SECOND FILE COUNT OF DATA RECORDS 00004 
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                           
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),         
  IFTHEN=(WHEN=(1,1,SS,EQ,C'H,T'),                           
  OVERLAY=(89:SEQNUM,1,ZD),HIT=NEXT),                       
  IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),                             
  OVERLAY=(73:81,8,ZD,SUB,+2,M11,LENGTH=8))                 
                                                             
  OUTFIL BUILD=(1,80),OMIT=(89,1,SS,EQ,C'2,3')               
//*                                                         
Back to top
View user's profile Send private message
chandra_devatha

New User


Joined: 10 Jul 2008
Posts: 4
Location: Hyderabad

PostPosted: Fri Jul 11, 2008 11:19 am    Post subject:
Reply with quote

Kolusu, Thanks a ton for your response.

I have tried executing the above. I am getting a SYSTEM=001 USER=0000 REASON=00000000 abend.

I have changed the above SORT Statements as below:

Code:

  SORT FIELDS=COPY
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(72:SEQNUM,8,ZD)),
    IFTHEN=(WHEN=(1,1,SS,EQ,C'H,T'),
       OVERLAY=(80:SEQNUM,1,ZD),HIT=NEXT),
    IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),
      OVERLAY=(73:72,8,ZD,SUB,+2,M11,LENGTH=8))

    OUTFIL BUILD=(1,80),OMIT=(80,1,SS,EQ,C'2,3')


even after changing as above I am still getting a S001 abend.

Could you please help.

Thanks,
Chandra

I
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jul 11, 2008 8:16 pm    Post subject:
Reply with quote

Hello,

Please post the jcl and diagnostic info from the abended run.

It is likely that you have a dataset problem.
Back to top
View user's profile Send private message
chandra_devatha

New User


Joined: 10 Jul 2008
Posts: 4
Location: Hyderabad

PostPosted: Mon Jul 14, 2008 11:30 am    Post subject:
Reply with quote

Hello Dick,

Here is what I have in my JOB

//STEP01 EXEC PGM=ICEMAN
//*-------------------------
//SYSOUT DD SYSOUT=*
//SORTIN DD *
H0012008-07-012008-07-31
DDATA RECORD ONE
DDATA RECORD TWO
DDATE RECORD THREE
TTRAILER RECORD FOR 1ST FILE. RECORD COUNT 00003
H0022008-07-01200807-31
DDATA RECORD FOUR
DDATA RECORD FIVE
DDATA RECORD SIX
DDATA RECORD SEVEN
TTRAILER RECORD FOR 2ND FILE. RECROD COUNT 00004
//SORTOUT DD *
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(72:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(1,1,SS,EQ,C'H,T'),
OVERLAY=(80:SEQNUM,1,ZD),HIT=NEXT),
IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),
OVERLAY=(73:72,8,ZD,SUB,+2,M11,LENGTH=8))

OUTFIL BUILD=(1,80),OMIT=(80,1,SS,EQ,C'2,3')
//*

Thanks,
Chandra
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jul 14, 2008 12:08 pm    Post subject:
Reply with quote

Hello,

That is part of what you needed to post. . .

You also need to post the diagnostic info presented by the run. There should be at least 2 "pieces" of diagnostic info. When you post these, the message numbers need to be included as well.
Back to top
View user's profile Send private message
chandra_devatha

New User


Joined: 10 Jul 2008
Posts: 4
Location: Hyderabad

PostPosted: Mon Jul 14, 2008 5:37 pm    Post subject:
Reply with quote

Hello Dick,

I was able to get this working. I guess the problem came when I tried with Instream data. I replaced SYSIN DD card with a dataset and it works well.

Kolusu, Thanks a lot. It works like a charm!

Regards,
Chandra
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jul 14, 2008 9:04 pm    Post subject:
Reply with quote

Hello,

Good to hear it is working icon_smile.gif

Quote:
I replaced SYSIN DD card with a dataset and it works well.
DCB mismatch problems with the instream data. . . . I'm sure the output dd * did not help icon_wink.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 ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm

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