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

how to apply INREC on header only


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

New User


Joined: 26 May 2006
Posts: 13

PostPosted: Sat May 31, 2008 1:46 am
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Sat May 31, 2008 3:39 am
Reply with quote

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
View user's profile Send private message
ansnero

New User


Joined: 26 May 2006
Posts: 13

PostPosted: Mon Jun 02, 2008 6:59 pm
Reply with quote

Thanks for the response. Sorry I did not mention to you earlier.
What if the file is VB?
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Mon Jun 02, 2008 7:06 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Mon Jun 02, 2008 8:51 pm
Reply with quote

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
View user's profile Send private message
ansnero

New User


Joined: 26 May 2006
Posts: 13

PostPosted: Tue Jun 03, 2008 3:05 am
Reply with quote

Thanks a lot Frank. It works as expected.
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

 


Similar Topics
Topic Forum Replies
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts No ++JCLIN, APPLY CHECK job JCL & VSAM 1
No new posts Comparing Header and Trailer. DFSORT/ICETOOL 7
No new posts INREC PARSE used to sort a CSV file DFSORT/ICETOOL 2
No new posts Adding a header when change data DFSORT/ICETOOL 6
Search our Forums:

Back to Top