View previous topic :: View next topic
|
Author |
Message |
ansnero
New User
Joined: 26 May 2006 Posts: 13
|
|
|
|
Hello all,
I have the following SORT card
//SYSIN DD *
INREC OVERLAY=(35:C'011',41:DATE2)
SORT FIELDS=COPY
/*
which applies the INREC on all records of the file
I have to do this only on the first record of the file. What change should I make to the SORT card? |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
ansnero
Use the following DFSORT control cards. I assumed that your input is FB recfm and 80 bytes in length.
Code: |
//SYSIN DD *
SORT FIELDS=COPY
INREC IFOUTLEN=80,
IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(81,8,ZD,EQ,1),OVERLAY=(35:C'011',41:DATE2))
/* |
|
|
Back to top |
|
|
ansnero
New User
Joined: 26 May 2006 Posts: 13
|
|
|
|
Thanks for the response. Sorry I did not mention to you earlier.
What if the file is VB? |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
ansnero,
Quote: |
What if the file is VB? |
You will have to take into consideration the extra 4 bytes for the RDW. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
ansnero,
Assuming that 35:C'011',41:DATE2 does not take the RDW into account so the fields you want to overlay are really at 39 and 45, you can use these DFSORT control statements to do what you asked for.
Code: |
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:SEQNUM,8,ZD,13:5)),
IFTHEN=(WHEN=(5,8,ZD,EQ,1),OVERLAY=(47:C'011',53:DATE2))
OUTREC BUILD=(1,4,5:13)
|
|
|
Back to top |
|
|
ansnero
New User
Joined: 26 May 2006 Posts: 13
|
|
|
|
Thanks a lot Frank. It works as expected. |
|
Back to top |
|
|
|