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
 
Copy header and trailer with record count including them

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

Active User


Joined: 01 Feb 2007
Posts: 120
Location: USA

PostPosted: Thu Mar 06, 2008 8:04 pm    Post subject: Copy header and trailer with record count including them
Reply with quote

Hi,

Here is my requirement.
My input file is of FB format and LRECL is 231 and two output files of same record length.

When 26,3 position is equal to ABC it should be written to ABC output file.
When 26,3 position is equal to XYZ or KLM it should be written to XYZ output file.
The header record for the output files should have the same header as input. The first 3 characters should be ABC or XYZ according to the output file replacing XXX.
The same way for the trailer record and the total record count should include header and trailer.

Input file will contain records as follows:
Code:

XXX200804211-FEB-2008 21:11:45                                         
20080211SMS   35305300003ABC   BDP14475825456887   THE TEXT
20080211SMS   35300000002ABC   BDP1447770450222    THE TEXT
20080211SMS   35300000001XYZ   BDP1441216527432    THE TEXT
20080211SMS   35305300009XYZ   BDP144221144541     THE TEXT
20080211SMS   35305300002XYZ   BDP14477787878787   THE TEXT
20080211SMS   35305300001XYZ   BDP14477785825641   THE TEXT
20080211SMS   35305300000KLM   BDP1442246448641    THE TEXT
20080211SMS   35305300000KLM   BDP1447777748641    THE TEXT
20080211SMS   35300000004KLM   BDP1442227984190    THE TEXT
XXX20080420000001111-FEB-2008 21:11:45                                 


ABC output file is as follows:
Code:

ABC200804211-FEB-2008 21:11:45                                 
20080211SMS   35300000001ABC   BDP1441216527432    THE TEXT
20080211SMS   35305300009ABC   BDP144221144541     THE TEXT
20080211SMS   35305300002ABC   BDP14477787878787   THE TEXT
20080211SMS   35305300001ABC   BDP14477785825641   THE TEXT
RBS20080420000000611-FEB-2008 21:11:45                         


XYZ output file is as follows:
Code:

XYZ200804211-FEB-2008 21:11:45                                 
20080211SMS   35305300003XYZ   BDP14475825456887   THE TEXT
20080211SMS   35300000002XYZ   BDP1447770450222    THE TEXT
20080211SMS   35305300000KLM   BDP1442246448641    THE TEXT
20080211SMS   35305300000KLM   BDP1447777748641    THE TEXT
20080211SMS   35300000004KLM   BDP1442227984190    THE TEXT
XYZ20080420000000711-FEB-2008 21:11:45                         


How can i do this. I had done this job which is very length and in 3 steps. I had attached here. How can i modify this to simpler. Or any other alternative solution.
Back to top
View user's profile Send private message

bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 120
Location: USA

PostPosted: Thu Mar 06, 2008 10:37 pm    Post subject: Reply to: Copy entire header and trailer with record count
Reply with quote

Hi,
Can anyone guide me for this job.
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: Fri Mar 07, 2008 12:15 am    Post subject:
Reply with quote

The output you show doesn't match your description of the rules.

I see two 26,3 = ABC records in the input file, but you show four in the output file - why?

I see four 26,3 = XYZ records in the input file, but you show two in the output file - why?

Why does the trailer record for the ABC output file have RBS instead of ABC?

Can the header and trailer records in the input file be identified by 'XXX' in positions 1-3 (the other records don't have that), or can they be identified some other way?

What is the starting position, length and format of the total record count value in the trailer record.
Back to top
View user's profile Send private message
bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 120
Location: USA

PostPosted: Fri Mar 07, 2008 3:30 pm    Post subject: Reply to: Copy header and trailer with record count includin
Reply with quote

Hi Frank,

Sorry i had given input wrongly. Thanks for pointing out.
Here is the corect input and output files.

Input file will contain records as follows:
Code:

XXX200804211-FEB-2008 21:11:45                                         
20080211SMS   35305300003ABC   BDP14475825456887   THE TEXT
20080211SMS   35300000002ABC   BDP1447770450222    THE TEXT
20080211SMS   35300000001ABC   BDP1441216527432    THE TEXT
20080211SMS   35305300009ABC   BDP144221144541     THE TEXT
20080211SMS   35305300002XYZ   BDP14477787878787   THE TEXT
20080211SMS   35305300001XYZ   BDP14477785825641   THE TEXT
20080211SMS   35305300000KLM   BDP1442246448641    THE TEXT
20080211SMS   35305300000KLM   BDP1447777748641    THE TEXT
20080211SMS   35300000004KLM   BDP1442227984190    THE TEXT
XXX20080420000001111-FEB-2008 21:11:45                                 


ABC output file is as follows:
Code:

ABC200804211-FEB-2008 21:11:45                                 
20080211SMS   35305300003ABC   BDP14475825456887   THE TEXT
20080211SMS   35300000002ABC   BDP1447770450222    THE TEXT
20080211SMS   35300000001ABC   BDP1441216527432    THE TEXT
20080211SMS   35305300009ABC   BDP144221144541     THE TEXT
ABC20080420000000611-FEB-2008 21:11:45                     


XYZ output file is as follows:
Code:

XYZ200804211-FEB-2008 21:11:45                                 
20080211SMS   35305300002XYZ   BDP14477787878787   THE TEXT
20080211SMS   35305300001XYZ   BDP14477785825641   THE TEXT
20080211SMS   35305300000KLM   BDP1442246448641    THE TEXT
20080211SMS   35305300000KLM   BDP1447777748641    THE TEXT
20080211SMS   35300000004KLM   BDP1442227984190    THE TEXT
XYZ20080420000000711-FEB-2008 21:11:45                         


Quote:

Can the header and trailer records in the input file be identified by 'XXX' in positions 1-3 (the other records don't have that), or can they be identified some other way?


Yes. Header and trailer records can be identified by 'XXX' in positions 1-3. Other data records wont have 'XXX'.

Quote:

What is the starting position, length and format of the total record count value in the trailer record.

The trailer record format is as follows.
Position 1-3 will be either ABC or XYZ depending on the file we are writing
position 4-10 should be the same value from the input file
position 11-18 will be the record count of LENGTH 8
position 19 onwards should be the same values from input file
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: Sat Mar 08, 2008 12:33 am    Post subject:
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/216)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  INCLUDE COND=(1,3,CH,EQ,C'XXX',AND,31,1,CH,NE,C' ')
  OUTFIL REMOVECC,
    BUILD=(C'STG1,''',4,7,C'''',80:X,/,
      C'STG2,''',19,22,C'''')
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file (FB/216)
//ABC DD DSN=...  ouput file1 (FB/216)
//XYZ DD DSN=...  ouput file2 (FB/216)
//SYSIN    DD    *
  OPTION COPY
  OMIT COND=(1,3,CH,EQ,C'XXX',AND,31,1,CH,NE,C' ')
  OUTFIL FNAMES=ABC,REMOVECC,
    INCLUDE=(1,3,CH,EQ,C'XXX',OR,26,3,CH,EQ,C'ABC'),
    IFTHEN=(WHEN=(1,3,CH,EQ,C'XXX'),OVERLAY=(1:C'ABC')),
    TRAILER1=(C'ABC',STG1,COUNT+1=(M11,LENGTH=8),STG2)
  OUTFIL FNAMES=XYZ,REMOVECC,
    INCLUDE=(1,3,CH,EQ,C'XXX',OR,26,3,SS,EQ,C'XYZ,KLM'),
    IFTHEN=(WHEN=(1,3,CH,EQ,C'XXX'),OVERLAY=(1:C'XYZ')),
    TRAILER1=(C'XYZ',STG1,COUNT+1=(M11,LENGTH=8),STG2)
/*
Back to top
View user's profile Send private message
bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 120
Location: USA

PostPosted: Mon Mar 10, 2008 4:48 pm    Post subject: Reply to: Copy header and trailer with record count includin
Reply with quote

Hi Frank,

Thank you so much.
It worked well.
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 query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts ISMF Difference between volume count ... upendrasri IBM Tools 2 Tue Dec 05, 2017 12:40 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm

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