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

Add condition to a FINDREP SORT card


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

New User


Joined: 03 Nov 2022
Posts: 30
Location: INDIA

PostPosted: Wed Sep 11, 2024 12:52 am
Reply with quote

I have prepared a sort card to scramble a data.
Code:

//SYSIN    DD *                                                   
  OPTION COPY                                                     
    OUTFIL FINDREP=(INOUT=(C'A',C'E',C'B',C'F',C'C',C'G',C'D',C'H',
  C'E',C'I',C'F',C'J',C'G',C'K',C'H',C'L',C'I',C'M',C'J',C'N',     
  C'K',C'O',C'L',C'P',C'M',C'Q',C'N',C'R',C'O',C'S',C'P',C'T',     
  C'Q',C'U',C'R',C'V',C'S',C'W',C'T',C'X',C'U',C'Y',C'V',C'Z',     
  C'W',C'A',C'X',C'B',C'Y',C'C',C'Z',C'D',                         
                           C'a',C'e',C'b',C'f',C'c',C'g',C'd',C'h',
  C'e',C'i',C'f',C'j',C'g',C'k',C'h',C'l',C'i',C'm',C'j',C'n',     
  C'k',C'o',C'l',C'p',C'm',C'q',C'n',C'r',C'o',C's',C'p',C't',     
  C'q',C'u',C'r',C'v',C's',C'w',C't',C'x',C'u',C'y',C'v',C'z',     
  C'w',C'a',C'x',C'b',C'y',C'c',C'z',C'd',                         
           C'0',C'3',C'1',C'4',C'2',C'5',C'3',C'6',C'4',C'7',     
  C'5',C'8',C'6',C'9',C'7',C'0',C'8',C'1',C'9',C'2'))             
/*                                                                 


This works perfectly.

I need to add only oine condition :
if "A' in position 133, apply this sort function in 1 to 132 position.
input file is a PS,FB,140.

Please help to add this condition in this SORT card.
Back to top
View user's profile Send private message
justjpr

New User


Joined: 03 Nov 2022
Posts: 30
Location: INDIA

PostPosted: Wed Sep 11, 2024 12:57 am
Reply with quote

FYI. This is the i/p and o/p of this sort card without condition
i/p:
Code:

ABCD&1234%                             
abcd(5678)                             
ABCD?1234/abcd'5678"ABCD$1234`abcd_5678-

o/p:
Code:

EFGH&4567%                             
efgh(8901)                             
EFGH?4567/efgh'8901"EFGH$4567`efgh_8901-
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1307
Location: Bamberg, Germany

PostPosted: Wed Sep 11, 2024 10:41 am
Reply with quote

Try this snippet:

Code:
OPTION COPY                                                       
  OUTFIL REMOVECC,IFTHEN=(WHEN=(133,1,CH,EQ,C'A'),               
FINDREP=(INOUT=(C'A',C'E',C'B',C'F',C'C',C'G',C'D',C'H',         
C'E',C'I',C'F',C'J',C'G',C'K',C'H',C'L',C'I',C'M',C'J',C'N',     
C'K',C'O',C'L',C'P',C'M',C'Q',C'N',C'R',C'O',C'S',C'P',C'T',     
C'Q',C'U',C'R',C'V',C'S',C'W',C'T',C'X',C'U',C'Y',C'V',C'Z',     
C'W',C'A',C'X',C'B',C'Y',C'C',C'Z',C'D',                         
                         C'a',C'e',C'b',C'f',C'c',C'g',C'd',C'h',
C'e',C'i',C'f',C'j',C'g',C'k',C'h',C'l',C'i',C'm',C'j',C'n',     
C'k',C'o',C'l',C'p',C'm',C'q',C'n',C'r',C'o',C's',C'p',C't',     
C'q',C'u',C'r',C'v',C's',C'w',C't',C'x',C'u',C'y',C'v',C'z',     
C'w',C'a',C'x',C'b',C'y',C'c',C'z',C'd',                         
         C'0',C'3',C'1',C'4',C'2',C'5',C'3',C'6',C'4',C'7',       
C'5',C'8',C'6',C'9',C'7',C'0',C'8',C'1',C'9',C'2'),ENDPOS=132))   
END
Back to top
View user's profile Send private message
justjpr

New User


Joined: 03 Nov 2022
Posts: 30
Location: INDIA

PostPosted: Wed Sep 11, 2024 10:08 pm
Reply with quote

Thanks Joerg Findeisen. It works.
This is what I need.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2119
Location: USA

PostPosted: Mon Sep 16, 2024 8:53 pm
Reply with quote

Here is a more compact version.

Code:
//SYSIN    DD  *                                                 
 ALTSEQ CODE=(C1C5,C2C6,C3C7,C4C8,C5C9,C6D1,C7D2,C8D3,C9D4,     
              D1D5,D2D6,D3D7,D4D8,D5D9,D6E2,D7E3,D8E4,D9E5,     
              E2E6,E3E7,E4E8,E5E9,E6C1,E7C2,E8C3,E9C4,           
              8185,8286,8387,8488,8589,8691,8792,8893,8994,     
              9195,9296,9397,9498,9599,96A2,97A3,98A4,99A5,     
              A2A6,A3A7,A4A8,A5A9,A681,A782,A883,A984,           
              F0F3,F1F4,F2F5,F3F6,F4F7,F5F8,F6F9,F7F0,F8F1,F9F2)
                                                                 
 SORT FIELDS=COPY                                               
                                                                 
 OUTREC  IFTHEN=(WHEN=(133,1,CH,EQ,C'A'),                       
                 OVERLAY=(1:1,132,TRAN=ALTSEQ))                 
//*                                                             


Code:
********************************* TOP OF DATA ******************
EFGH&4567%                                                     
efgh(8901)                                                     
EFGH?4567/efgh'8901"EFGH$4567`efgh_8901-                       
******************************** BOTTOM OF DATA ****************
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 SORT CARD meaning please DFSORT/ICETOOL 3
No new posts Sort based on the record type DFSORT/ICETOOL 1
No new posts SORT JCL to merge multiple tow into s... DFSORT/ICETOOL 6
No new posts To Omit records based n SORT condition DFSORT/ICETOOL 6
No new posts Using Multiple IFTHEN and WHEN condit... SYNCSORT 12
Search our Forums:

Back to Top