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
 

 

Reset only perticular records by specifing IF condition

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

New User


Joined: 19 Dec 2004
Posts: 24
Location: hyderabad

PostPosted: Tue May 08, 2007 4:19 pm    Post subject: Reset only perticular records by specifing IF condition
Reply with quote

Hi,


In one File i would like to set one field(having length 1 byte) value to 'Y' using DFSORT utility, if the Field Value in the File is 'N'.

I am not sure how to use IF condition in Sort to Reset that value after checking value of that Field.

Field position in the file is 2585.



Thanks

venkat

Warning: Do not use Forum name as Topic Title. Title Edited
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue May 08, 2007 4:25 pm    Post subject:
Reply with quote

This is almost identical to your previous post.

http://ibmmainframes.com/viewtopic.php?t=20571
Back to top
View user's profile Send private message
venkatarao

New User


Joined: 19 Dec 2004
Posts: 24
Location: hyderabad

PostPosted: Tue May 08, 2007 5:12 pm    Post subject: Re: DFSORT
Reply with quote

Hi,

yes. it's almost similar.

Here i am asking about how to Reset only perticular records(value which is having 'N') by specifing if condition in DFSort.

pls let me know if need any information.


Thanks
Venkat
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Tue May 08, 2007 5:59 pm    Post subject:
Reply with quote

Hey,


Try this one..

Code:

  SORT FIELDS=COPY                                         
  OUTREC FIELDS=(1:1,2584,2585:2585,1,CHANGE=(1,C'N',C'Y'))
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Tue May 08, 2007 7:34 pm    Post subject:
Reply with quote

oops... sorry..u have to add this NOMATCH to get the correct result for ur requirement..

Code:

  SORT FIELDS=COPY                                         
  OUTREC FIELDS=(1:1,2584,2585:2585,1,CHANGE=(1,C'N',C'Y'),NOMATCH=(2585,1))


the earlier code will give an abend if any value except N comes in that particular position.

When u add NOMATCH, the records which has a different value than N in position 2585 will have the same value.. i.e. it won't get changed.
Back to top
View user's profile Send private message
venkatarao

New User


Joined: 19 Dec 2004
Posts: 24
Location: hyderabad

PostPosted: Tue May 08, 2007 9:04 pm    Post subject: Re: Reset only perticular records by specifing IF condition
Reply with quote

Hi raak,

can u please explain the given syntax.

OUTREC FIELDS=(1:1,2584,2585:2585,1,CHANGE=(1,C'N',C'Y'),NOMATCH=(2585,1))

I am not clear how u r spcifing positions 1:1,2584,2585:2585,1


Thanks
venkat
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: Tue May 08, 2007 9:24 pm    Post subject:
Reply with quote

Venkat,

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(2585,1,CH,EQ,C'N'),OVERLAY=(2585:C'Y'))
/*
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: Tue May 08, 2007 9:31 pm    Post subject:
Reply with quote

raak,

Your "solution" will truncate any bytes in the input file past position 2585 so it only works if the LRECL is 2585. You would need to add in the other input positions to make it work for an LRECL greater than 2585. But for this kind of thing, it's much easier to use DFSORT's OVERLAY function so you don't have to worry about the positions before and after the position to be changed. Also DFSORT's newer IFTHEN/OVERLAY function is easier to use then DFSORT's older CHANGE function. You need to update your bag of tools.
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 Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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