IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Read Write header detail and Trailer


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Escapa

Senior Member


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

PostPosted: Mon Feb 22, 2010 5:08 pm
Reply with quote

Quote:
Trailers are in the following formats.
Senerio1:
ZZ.......
EE0000000
99000005C
Senerio2:
.......á.
FF0000042
FF000015C

What you want us to guess from this? icon_question.gif
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:11 pm
Reply with quote

Sorry ... These are in HEX format..

Senerio1: records of 50
ZZ.......
EE0000000
99000005C

Senerio2: records fo 1542
.......á.
FF0000042
FF000015C
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:22 pm
Reply with quote

Very sorry if you are confusing..

JS010 EXEC PGM=SORT
SORTIN DD DISP=SHR,DSN=AAA.ABC.MBR
SORTOUT DD DSN=AAA.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

The Above sort copies Header ,(One)Detail and Trailer reocrd to optput file 'AAA.ABC.TEST'.

Need to update Trailer record of the out put file as it has only one detail record.

Senerio1:
Trailer start with ZZ

Senerio2:
Trailer start with FF


Please let me know how to update the trailer record.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Feb 23, 2010 12:24 am
Reply with quote

It's still not clear what you want to do.

Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files.
Back to top
View user's profile Send private message
brahmanandarm

New User


Joined: 15 Jun 2009
Posts: 28
Location: bangalore

PostPosted: Tue Feb 23, 2010 1:49 pm
Reply with quote

Here are more details..


Input FILE
AA2007-07-12ABCDE D
DDDDD 00000000000000111111111MBRBRAHMAN ABC - AXEA VOERL
DDDDD 00000000000000232131231MALLIKAJUN RED - ABYC EREAD
DDDDD 000000000000001212161212MIREREEAIA AEA TESTING
DDDDD 00000000000000121210911LMI REDDO EVW TESTING
ZZ


OUTPUT:
AA2007-07-12ABCDE D
DDDDD 00000000000000111111111MBRBRAHMAN ABC - AXEA VOERL
ZZ


Here the output trilar record(Packed Decimal) has record count of 4 where it has to be 1.

I have used the fllowing 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

Please let me know how to update the trialer count.
(The output of abouve query alwas has one record) I am fine with updating(Default) as 1 for Trailer Record.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Feb 23, 2010 9:31 pm
Reply with quote

Well, you didn't give the starting position or length of the PD count field you want in the ZZ record, so I'll assume it starts in position 3 and has a length of 8 bytes. Here's a DFSORT job that will do what you asked for with those assumptions. Change as needed.

Code:

//S1 EXEC PGM=SORT                                                 
//SYSOUT DD SYSOUT=*                                               
//SORTIN DD *                                                       
AA2007-07-12ABCDE D                                                 
DDDDD 00000000000000111111111MBRBRAHMAN ABC - AXEA VOERL           
DDDDD 00000000000000232131231MALLIKAJUN RED - ABYC EREAD           
DDDDD 000000000000001212161212MIREREEAIA AEA TESTING               
DDDDD 00000000000000121210911LMI REDDO EVW TESTING                 
ZZ                                                                 
//SORTOUT DD ...  output file     
//SYSIN DD *                                                       
  OMIT COND=(1,2,CH,EQ,C'ZZ')                                       
  SORT FIELDS=(1,2,AC,A)                                           
  SUM FIELDS=NONE                                                   
  OUTFIL REMOVECC,                                                 
    TRAILER1=('ZZ',COUNT-1=(TO=PD,LENGTH=8)) 
/*                     
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
This topic is locked: you cannot edit posts or make replies. How To Write, Compile and Execute Cob... COBOL Programming 5
Search our Forums:

Back to Top