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
 

 

Read Write header detail and Trailer
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
brahmanandarm

New User


Joined: 15 Jun 2009
Posts: 28
Location: bangalore

PostPosted: Fri Feb 19, 2010 10:12 am    Post subject: Read Write header detail and Trailer
Reply with quote

Hi All,

Would need to read the file
1. If the file contains header detail and trailer then write header ONE detail and trailer record to the output file.
2. If the file contains only detail record then write ONE detail record to the output file.
3. If the file contains header and trailer then write header and trailer

Can some one help me to solve above quey using ICETOOL.
Back to top
View user's profile Send private message

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Fri Feb 19, 2010 10:18 am    Post subject:
Reply with quote

Hi,

Show us the input file records, LRECL, RECFM and the scenarios and cases with example, so someone can help.
Back to top
View user's profile Send private message
brahmanandarm

New User


Joined: 15 Jun 2009
Posts: 28
Location: bangalore

PostPosted: Fri Feb 19, 2010 10:35 am    Post subject: Reply to: Read Write header detail and Trailor
Reply with quote

Hi,

We would need to run a batch stream where there are some JOBs which uses previous day files.(we found around 200 previous day files).

So we plan to copy header one detail and trailer record from previous day files in order to complete the stream.

So, the record lenght varies from file to file (as we have 200 previous day files).

Pleas advice if there are any generic tool to copy.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Feb 19, 2010 11:30 am    Post subject:
Reply with quote

How Header\detail\trailer record is identified?
Back to top
View user's profile Send private message
brahmanandarm

New User


Joined: 15 Jun 2009
Posts: 28
Location: bangalore

PostPosted: Fri Feb 19, 2010 11:37 am    Post subject: Reply to: Read Write header detail and Trailor
Reply with quote

Hi,

we have few Scenarios
Scenario 1:
Header starts with AA
Detail starts with DD
Trailer start with ZZ

Scenario 2:
Header starts with 00
Detail starts with 0A
Trailer start with FF

Scenario 3:
Header starts with 00
Detail starts with 03
Trailer start with FF
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Feb 19, 2010 12:37 pm    Post subject:
Reply with quote

Hi Brahmanandaram,
Below sortcard will give you desired result...
It will work for all scenarios you have shown.
Code:

//S1    EXEC  PGM=SORT               
//SORTIN DD DSN=your dsn here,DISP=SHR                   
//SORTOUT DD SYSOUT=*               
//SYSOUT    DD  SYSOUT=*             
//SYSIN    DD *                     
  SORT FIELDS=(1,2,AQ,A)             
  ALTSEQ CODE=(C1F2,C6F9,C4F3,E9F9) 
  SUM FIELDS=NONE                   
Back to top
View user's profile Send private message
brahmanandarm

New User


Joined: 15 Jun 2009
Posts: 28
Location: bangalore

PostPosted: Fri Feb 19, 2010 2:40 pm    Post subject: Reply to: Read Write header detail and Trailor
Reply with quote

Thanks a lot it is working

The out put is
Trailer
Header
Detail

Could you plase let me know how to create the out put as
Header
Detail
Trailer
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Feb 19, 2010 2:43 pm    Post subject:
Reply with quote

Quote:
Thanks a lot it is working

The out put is
Trailer
Header
Detail

Could you plase let me know how to create the out put as
Header
Detail
Trailer

Can you please show sample input used for this?
Back to top
View user's profile Send private message
brahmanandarm

New User


Joined: 15 Jun 2009
Posts: 28
Location: bangalore

PostPosted: Fri Feb 19, 2010 2:50 pm    Post subject: Reply to: Read Write header detail and Trailor
Reply with quote

Hi,

Here is the sample output

ZZ
AA2007-07-12ABCSAM P
DDDDD 00000000000000112121212BRAHMANADA ABC - ACLL COTAT
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Feb 19, 2010 2:56 pm    Post subject:
Reply with quote

Sambhaji wrote:
Can you please show sample input used for this?

Quote:

Hi,

Here is the sample output

I asked for input icon_evil.gif
Back to top
View user's profile Send private message
brahmanandarm

New User


Joined: 15 Jun 2009
Posts: 28
Location: bangalore

PostPosted: Fri Feb 19, 2010 3:13 pm    Post subject: Reply to: Read Write header detail and Trailor
Reply with quote

Sorry..

Here is the sample Input

Code:
AA2007-07-12HFRINS  D                                     
DDDDD  00000000000000111111111MBRBRAHMAN ABC - AXEA VOERL 
DDDDD  00000000000000232131231MALLIKAJUN RED - ABYC EREAD 
DDDDD  000000000000001212161212MIREREEAIA AEA TESTING     
DDDDD  00000000000000121210911LMI    REDDO EVW TESTING     
ZZ
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Feb 19, 2010 4:01 pm    Post subject:
Reply with quote

Code:

//S1    EXEC  PGM=SORT                                   
//SORTIN DD *                                             
AA2007-07-12HFRINS  D                                     
DDDDD  00000000000000111111111MBRBRAHMAN ABC - AXEA VOERL
DDDDD  00000000000000232131231MALLIKAJUN RED - ABYC EREAD
DDDDD  000000000000001212161212MIREREEAIA AEA TESTING     
DDDDD  00000000000000121210911LMI    REDDO EVW TESTING   
ZZ                                                       
//SORTOUT DD SYSOUT=*                                     
//SYSOUT    DD  SYSOUT=*                                 
//SYSIN    DD *                                           
  SORT FIELDS=(1,2,AQ,A)                                 
  ALTSEQ CODE=(C1F2,C6F9,C4F3,E9F9)                       
  SUM FIELDS=NONE                                         

Output:
Code:

AA2007-07-12HFRINS  D                                                   
DDDDD  00000000000000111111111MBRBRAHMAN ABC - AXEA VOERL               
ZZ                                                                     
Back to top
View user's profile Send private message
brahmanandarm

New User


Joined: 15 Jun 2009
Posts: 28
Location: bangalore

PostPosted: Fri Feb 19, 2010 4:23 pm    Post subject: Reply to: Read Write header detail and Trailor
Reply with quote

hi,

In my case i am not geeting the correct fromat

Code:
//JS010    EXEC  PGM=SORT,                       
//             REGION=0M                         
//SORTIN DD DISP=SHR,DSN=ABC.INPUT.TEST
//SORTOUT DD DSN=ABC.OUTPUT.TEST,   
//         DISP=(NEW,CATLG,DELETE),               
//         SPACE=(100,(1,2),RLSE),               
//         UNIT=SYSDA                             
//SYSOUT    DD  SYSOUT=*                         
//SYSIN    DD *                                   
  SORT FIELDS=(1,2,AQ,A)                         
  ALTSEQ CODE=(C1F2,C6F9,C4F3,E9F9)               
  SUM FIELDS=NONE                                 



OUTPUT

Code:
ZZ.......                                                                       
AA2007-07-12HFRINS  D                                                           
DDDDA..00000000000000850462041LMILMIAANZ LMI - FULL COVER                    000
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Feb 19, 2010 5:40 pm    Post subject:
Reply with quote

I am clueless on this.. May we need to wait for Frank\Kolusu to come.

Have patience till then..
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Feb 19, 2010 5:57 pm    Post subject: Re: Reply to: Read Write header detail and Trailor
Reply with quote

vasanthz wrote:
Show us the input file records, LRECL, RECFM and...

brahmanandarm wrote:
...the record lenght varies from file to 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: Fri Feb 19, 2010 10:56 pm    Post subject:
Reply with quote

brahmanandarm,

I tried Sambhaji's solution for all three cases and it works fine, although this would be a simpler way of doing it with DFSORT:

Code:

  SORT FIELDS=(1,2,AC,A)       
  SUM FIELDS=NONE               


If it's not working for you, then I can only guess that your RECFM is VB so the identifier actually starts in position 5 (after the RDW), not in position 1, in which case you would use:

Code:

  SORT FIELDS=(5,2,AC,A)       
  SUM FIELDS=NONE               


If your RECFM is FB, then there's something else you're not telling us so you need to show the complete job you're using and the //SYSOUT messages you received.
Back to top
View user's profile Send private message
brahmanandarm

New User


Joined: 15 Jun 2009
Posts: 28
Location: bangalore

PostPosted: Mon Feb 22, 2010 10:53 am    Post subject: Reply to: Read Write header detail and Trailor
Reply with quote

Hi,

The RECFM is VB and is working fine .........


Is their any way where we can execute the step with either of the record format (VB or FB)
Back to top
View user's profile Send private message
brahmanandarm

New User


Joined: 15 Jun 2009
Posts: 28
Location: bangalore

PostPosted: Mon Feb 22, 2010 4:11 pm    Post subject: Reply to: Read Write header detail and Trailor
Reply with quote

Hi All,

How do i update the trailer record count....
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Feb 22, 2010 4:52 pm    Post subject:
Reply with quote

Quote:

Hi All,

How do i update the trailer record count....

You are just repeating mistake of not stating your requirement properly\completely...

Where is the count? What format count is in?
Till now none of the examples given has count at trailer record
Back to top
View user's profile Send private message
brahmanandarm

New User


Joined: 15 Jun 2009
Posts: 28
Location: bangalore

PostPosted: Mon Feb 22, 2010 5:02 pm    Post subject: Reply to: Read Write header detail and Trailor
Reply with quote

Here is the sample code
Hi,


//JS010 EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=AIW.ABC.MBR
//SORTOUT DD DSN=AIW.ABC.TEST,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(100,(2,2),RLSE)
// DCB=*.SORTIN
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(5,2,AQ,A)
ALTSEQ CODE=(C1F2,C6F9,C4F3,E9F9)
SUM FIELDS=NONE


Would nee the Trailer update the trailer count.
Trailers are in the following formats.
Senerio1:
ZZ.......
EE0000000
99000005C
Senerio2:
.......รก.
FF0000042
FF000015C
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm
No new posts CICS VSAM RLS READ akodakka CICS 3 Tue Oct 04, 2016 3:09 pm
No new posts how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am


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