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

Change command in OUTREC of SORT utility


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Harish Kumar

New User


Joined: 20 Jul 2007
Posts: 4
Location: 26,leela nivas, Pari nagar, Sungam, Coimbatore

PostPosted: Tue Sep 11, 2007 12:49 pm
Reply with quote

Hi,

Can someone tell me if it is possible to include a compare for fields in the change command of Outrec part of a sort card?

Say, if the value in position 120 to 125, OR the value from 140 to 145, in the input file, which are both packed decimal values, are greater than 0, then move 'A' to position 300 of the output file, else move 'B' to position 300 of the output file.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Sep 11, 2007 1:10 pm
Reply with quote

Harish,

Duplicate post?

Anyway sort card for your req -

Code:
//SYSIN DD *
  OPTION COPY                                       
  INREC IFTHEN=(WHEN=(120,6,PD,GT,0,OR,140,6,PD,GT,0),   
       OVERLAY=(300:C'A')),                 
     IFTHEN=(WHEN=NONE,OVERLAY=(300:C'B'))         
/*
Back to top
View user's profile Send private message
Harish Kumar

New User


Joined: 20 Jul 2007
Posts: 4
Location: 26,leela nivas, Pari nagar, Sungam, Coimbatore

PostPosted: Tue Sep 11, 2007 1:31 pm
Reply with quote

thanks for the reply....

but can this be used for both INREC and OUTREC statemeents?

Also, is this an alternative to the CHANGE command?
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Tue Sep 11, 2007 2:31 pm
Reply with quote

Hi Harish,

1. Yes, this can be used in both INREC and OUTREC.

2. I guess, this is not an alternative to CHANGE command. This is because with the help of change command you can change or replace a string, but you cannot compare the value of a field.

--Parag
Back to top
View user's profile Send private message
Harish Kumar

New User


Joined: 20 Jul 2007
Posts: 4
Location: 26,leela nivas, Pari nagar, Sungam, Coimbatore

PostPosted: Tue Sep 11, 2007 2:54 pm
Reply with quote

thanks a lot guys....saved my day!!
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: Tue Sep 11, 2007 8:45 pm
Reply with quote

Harish wrote
Quote:
Also, is this an alternative to the CHANGE command?


IFTHEN clauses can do everything the CHANGE function can do, and more.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
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 -> DFSORT/ICETOOL

 


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 RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top