Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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
Author Message
ansnero

New User


Joined: 26 May 2006
Posts: 5

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
References
Skolusu

DFSORT Developer


Joined: 07 Dec 2007
Posts: 357
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: 5

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: 1174
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: 4619
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: 5

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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1