View previous topic :: View next topic
|
Author |
Message |
nithya_s_raman
New User
Joined: 30 Oct 2007 Posts: 3 Location: India
|
|
|
|
I have an input file length = 300. In the output file I need to have the column position 251-253 changed to '01 ' if column 33-35 is '29 '. Is it possible to do so in a single sort step? |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
nithya,
Yes, this is possible with the OVERLAY command.
Quote: |
I need to have the column position 251-253 changed to '01 ' if column 33-35 is '29 |
check if you have mentioned the correct column no's as cols 251 - 253 (3 bytes) and you want that to be replaced with a 2 byte value. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
nitya,
Code: |
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN= input file,DISP=SHR
//SORTOUT DD DSN=output file,DISP=(,CATLG,DELETE)
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(33,2,CH,EQ,C'29'),OVERLAY=(251:C'01'))
/* |
|
|
Back to top |
|
|
nithya_s_raman
New User
Joined: 30 Oct 2007 Posts: 3 Location: India
|
|
|
|
I tried using the options provided, but when I run the job its giving syntax error. Maybe IFTHEN and OVERLAY are not supported by syncsort.
Thanks for all your help. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Nitya,
Post the spool messages. May be some will help you out. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
nithya,
Quote: |
Maybe IFTHEN and OVERLAY are not supported by syncsort.
|
What version of SYNCSORT are you using? Try using BUILD instead of OVERLAY
Code: |
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(33,2,CH,EQ,C'29'),BUILD=(1,250,251:C'01',253,48)) |
|
|
Back to top |
|
|
nithya_s_raman
New User
Joined: 30 Oct 2007 Posts: 3 Location: India
|
|
|
|
I think the version of syncsort is 1.1
The build option is also not working. here is a copy of the spool.
SYSIN :
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(33,3,CH,EQ,C'29 '),
*
BUILD=(1,250,251:C'01 ',254,47))
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Nitya,
Quote: |
Maybe IFTHEN and OVERLAY are not supported by syncsort.
|
Even am using SYNCSORT but the version is not the one which you are using. As you said IFTHEN and OVERLAY are not supported by the SYNCSORT version which you are using. |
|
Back to top |
|
|
skkp2006
New User
Joined: 14 Jul 2006 Posts: 93 Location: Chennai,India
|
|
|
|
Can u try this ????
Code: |
OPTION COPY
INREC IFTHEN=(WHEN=(33,2,CH,EQ,C'29'),OVERLAY=(251:C'01')) |
Syam |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
skkp2006
What version of SYNCSORT you are using?
Check it in SPOOL, and let us know! |
|
Back to top |
|
|
skkp2006
New User
Joined: 14 Jul 2006 Posts: 93 Location: Chennai,India
|
|
|
|
I am using SYNCSORT FOR Z/OS 1.2.2.2R. I think that the above code requires SyncSort for z/OS 1.2.1 or later.
Syam |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
skkp2006 wrote: |
I am using SYNCSORT FOR Z/OS 1.2.2.2R. I think that the above code requires SyncSort for z/OS 1.2.1 or later.
Syam |
Have no idea as to exactly from which version the SYNCSORT has capability for IFTHEN.
The only way of verification i could think of is, if the * is exactly below the IFTHEN then you dont have facility of IFTHEN.
Like this
Code: |
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(33,3,CH,EQ,C'29 '),
*
|
|
|
Back to top |
|
|
|