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
 

 

Change only header rec to have low values from col 2 to 11

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
kpmdreamz

New User


Joined: 05 Apr 2007
Posts: 4
Location: Bangalore

PostPosted: Mon May 04, 2009 12:09 pm    Post subject: Change only header rec to have low values from col 2 to 11
Reply with quote

Hi,
I have a file in which the header record is incorrect (It should have low values from col 2 to 11). I want a sort step to introduce low values from col 2 to 11 i.e. 9 bytes.
How to do it.
I have tried

Code:

   SORT FIELDS=COPY
   OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(2:X'000000000000000000'))


But this changes all records. How to apply it to only the header record.
Back to top
View user's profile Send private message

Escapa

Senior Member


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

PostPosted: Mon May 04, 2009 12:18 pm    Post subject:
Reply with quote

Yes it will change all the records..as you are doing overlay in WHEN=INIT
which applies to all records.

can you post sample input file. How header is identified? using some record type indicator? or positioned as first record?
Back to top
View user's profile Send private message
kpmdreamz

New User


Joined: 05 Apr 2007
Posts: 4
Location: Bangalore

PostPosted: Mon May 04, 2009 12:21 pm    Post subject: Reply to: Change only header rec to have low values from col
Reply with quote

Thanks for the reply Sambhaji,
My file has only one header positioned as first record (doesn't have any rec type indicator)
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Mon May 04, 2009 1:10 pm    Post subject:
Reply with quote

Assuming your LRECL is 80

Code:

//SYSIN    DD  *                                                   
  SORT FIELDS=COPY                                                 
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),               
     IFTHEN=(WHEN=(81,8,ZD,EQ,1),OVERLAY=(2:X'000000000000000000'))
  OUTREC BUILD=(1,80)                                               
/*                                                                 
Back to top
View user's profile Send private message
kpmdreamz

New User


Joined: 05 Apr 2007
Posts: 4
Location: Bangalore

PostPosted: Mon May 04, 2009 1:36 pm    Post subject: Reply to: Change only header rec to have low values from col
Reply with quote

Thanks a lot.
It worked great.
Thanks for intoducing the concept of SEQNUM. I checked the manual its great stuff.
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 May 04, 2009 9:21 pm    Post subject:
Reply with quote

Note that instead of 2:X'000000000000000000' you can use 2:9Z or 2:9X'00'.
Back to top
View user's profile Send private message
kpmdreamz

New User


Joined: 05 Apr 2007
Posts: 4
Location: Bangalore

PostPosted: Fri Jun 12, 2009 11:26 am    Post subject:
Reply with quote

Thanks Frank - Saw it after a long time icon_smile.gif
I had indeed used 2:9x'00'. But i did not know that i could use 2:9Z
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 Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


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