View previous topic :: View next topic
|
Author |
Message |
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
hi,
i want to replace any negative number with zero
say eample
input(lrecl=10)
Code: |
store1+100
store2+10
store3-50
store4-25
store5+200
|
my output should be
Code: |
store1+100
store2+10
store3+0
store4+0
store5+200
|
can this be achieved in JCL?
Regds,
useit |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
using jcl No
using Your sort product Yes
since You asked for a Yes/no answer that' s what You got
as usual post the result of this job so that the good soul willing to provide a solution will know the sort product You are using
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
DUMMY
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
/*
|
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
this should work with DFSORT or SYNCSORT
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
STORE1+100
STORE2+10
STORE3-50
STORE4-25
STORE5+200
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(7,1,CH,EQ,C'-'),
BUILD=(1,6,C'+0',10:X)),
IFTHEN=(WHEN=NONE,
BUILD=(1,10))
/*
|
Gerry |
|
Back to top |
|
|
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
enrico,
please find the below details
Code: |
1ICE805I 1 JOBNAME: AAAAAAAA , STEPNAME: S1
ICE802I 0 BLOCKSET TECHNIQUE IN CONTROL
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
...
|
Regds,
useit |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
well looks like Gerry already gave You the reply!
topic moved to the DFSORT/ICETOOL section
the snippet posted works because of the fixed position of the minus sign,
if the layout is different ( unaligned or right aligned field ) it might not work |
|
Back to top |
|
|
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
thanx gerry and enrico-sorichetti:) your solution worked for me..
thanx a ton |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
useit,
I would suggest this slightly simpler DFSORT job:
Code: |
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/10)
//SORTOUT DD DSN=... output file (FB/10)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(7,1,CH,EQ,C'-'),
OVERLAY=(7:C'+0 ')
/*
|
|
|
Back to top |
|
|
|