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
 

 

how to apply INREC on header only

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: how to apply INREC on header only
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    Post subject: Reply to: how to apply INREC on header only
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    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Mon Jun 02, 2008 7:06 pm    Post subject: Reply to: how to apply INREC on header only
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 Moderator


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

PostPosted: Mon Jun 02, 2008 8:51 pm    Post subject:
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    Post subject:
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    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 Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts What does this INREC do? Lino Pontes DFSORT/ICETOOL 5 Fri Apr 08, 2016 12:17 am
No new posts Remove header only knobi SYNCSORT 5 Mon Feb 15, 2016 10:42 pm
No new posts GROUP - header data to be repeated in... Musab Ahmed DFSORT/ICETOOL 3 Mon Feb 01, 2016 11:36 am
No new posts Add Counts to Group Header Records Christopher Horowitz SYNCSORT 3 Sat Jul 11, 2015 1:21 am


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