Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Change operand in sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Change operand in sort
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 Moderator


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

PostPosted: Thu Oct 23, 2008 3:15 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us