----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
********************************* Top of Data *********************************
.å..a.<13012D574479.D011574479 2011.......ABC1253A388721 1D...%5744792
.å..a.<13012D574479.D011574479 2011.Ø.....BCD1253H371664 1D...%5744792
.å..a.<13012D574479.D011574479 2011.Ø.....EFG1253H446734 1D...%5744792
....a.<13012N 13542..011 13542 2011.-..... 12345678 B ../- 135424
....a.<13012N 13542..011 13542 2011.-..... 34526729 B ../-7922801
....a.<13012N 13542..011 13542 2011.-..... 23456789 B ../-LAOD2 1
....a.<13012N 13542..011 13542 2011.Ø..... 99999344 Q ../-7807907
i want to reformat this file, by removing the leading spaces in field starting at position 47 until 65 (field length 19).
I was using the sort card like this but getting an error:
Code:
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(47,1,CH,EQ,C' '),
BUILD=(1:48,18,19:47,1,20:1,2,BI,EDIT=(TTT)))
IFTHEN=WHEN=(47,1,CH,NE,EQ,C' '),
*
BUILD=(1:47,19,20:1,2,BI,EDIT=(TTT)))
*
END
WER161B ALTERNATE PARM USED
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(47,1,CH,EQ,C' '),
BUILD=(1:48,18,19:47,1,20:1,2,BI,EDIT=(TTT)))
IFTHEN=WHEN=(47,1,CH,NE,EQ,C' '),
*
BUILD=(1:47,19,20:1,2,BI,EDIT=(TTT)))
*
END
WER161B ALTERNATE PARM USED
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Please advise where i am going wrong.
I believe you are missing a comma after the first BUILD statement and an open parenthesis before the second WHEN statement.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
leo_sangha,
Apart from what Alissa has pointed out, I see this one too.
Quote:
IFTHEN=WHEN=(47,1,CH,NE,EQ,C' '),
If you've only 2 IFTHEN conditions and if both are mutually exclusive you can simply use the WHEN=NONE condition instead of writing the entire condition again.
Also, if the output field positions are contigous you can omit the output field starting position.
I have modified your card accordingly and got the below results.