View previous topic :: View next topic
Author
Message
justjpr New User Joined: 03 Nov 2022Posts: 30 Location: INDIA
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
justjpr New User Joined: 03 Nov 2022Posts: 30 Location: INDIA
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
Joerg.Findeisen Senior Member Joined: 15 Aug 2015Posts: 1307 Location: Bamberg, Germany
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
justjpr New User Joined: 03 Nov 2022Posts: 30 Location: INDIA
Thanks Joerg Findeisen. It works.
This is what I need.
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2119 Location: USA
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
Please enable JavaScript!