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

Change operand in sort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ywheeler

New User


Joined: 10 Nov 2006
Posts: 19
Location: New York

PostPosted: Thu Oct 23, 2008 12:43 am
Reply with quote

I am trying to CHANGE a value in a field using sort. I have one sortin file which I need to :

SORT FIELDS= (1,8,CH,A)
OUTFIL FNAMES=SORTOF1...
OUTFIL FNAMES=SORTOF2...

1) SORTOF1 = THE FULL SORTIN FILE
2) SORTOF2 = the full sortin and change a value in a field if another field has a certain criteria.

example.
Layout : pos 1-8 Name
pos 9-13 T-Nbr
pos 14-18 S-Nbr

SORTOF2 OUTREC=(1,8, IF T-NBR = 12345 THEN S-NBR = 65987 ELSE S-NBR = S-NBR)

Thanks.
icon_confused.gif
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: Thu Oct 23, 2008 3:15 am
Reply with quote

You can use these DFSORT control statements to do what you asked for:

Code:

  SORT FIELDS=(1,8,CH,A)               
  OUTFIL FNAMES=SORTOF1               
  OUTFIL FNAMES=SORTOF2,               
    IFTHEN=(WHEN=(9,5,CH,EQ,C'12345'),
      OVERLAY=(14:C'65987'))           
Back to top
View user's profile Send private message
ywheeler

New User


Joined: 10 Nov 2006
Posts: 19
Location: New York

PostPosted: Thu Oct 23, 2008 6:21 pm
Reply with quote

Frank, Thanks so much.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top