|
View previous topic :: View next topic
|
| Author |
Message |
Mane Sagar
New User

Joined: 12 Jul 2005 Posts: 41 Location: mumbai
|
|
|
|
Hi,
I have an input file and have to split it as per a condition at position 7(if CD='PER' and 'PEN)
and have to add a new field at the 15th position.
I tried to do this with ICETOOl but it abends. Can you please let me know the error in the jcl I have written.
The record length of the input file is 52.
The JCL that I have written is :
| Code: |
//********************************************************
//* COPY
//********************************************************
//STEP01 EXEC PGM=ICETOOL,
// COND=(4,LT)
//*
//SORTIN DD DSN=ASOS.CISPGM.INPUT.TEST2,
// DISP=SHR
//*
//OUT1 DD DSN=ASOS.CISPGM.TEST.CURRENT1,
// DISP=(NEW,CATLG,CATLG),
// UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
// DCB=(RECFM=FB,LRECL=34,BLKSIZE=0)
//
//OUT2 DD DSN=ASOS.CISPGM.TEST.CURRENT2,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
// DCB=(RECFM=FB,LRECL=34,BLKSIZE=0)
//
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//*
//TOOLIN DD * *** CONSTANT CONTROL CARDS ***
COPY FROM(SORTIN) USING(CTL1)
//CTL1CNTL DD * *** CONSTANT CONTROL CARDS ***
OUTFIL FNAMES=OUT1,
INCLUDE=(07,3,CH,EQ,C'PEN'),
OUTREC=(01:19,5,
06:24,9,
15:3C'33D',
18:1,6,
24:42,11)
OUTFIL FNAMES=OUT2,
INCLUDE=(07,3,CH,EQ,C'PER'),
OUTREC=(01:19,5,
06:24,9,
15:3C'33D',
18:1,6,
24:42,11)
/* END OF INPUT
//*
|
And the error is :
| Code: |
ICE000I 0 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 07:46 ON TUE JAN
OUTFIL FNAMES=OUT1,
INCLUDE=(07,3,CH,EQ,C'PEN'),
OUTREC=(01:19,5,
06:24,9,
15:3C'33D',
18:1,6,
24:42,11)
ICE146I 0 END OF STATEMENTS FROM CTL1CNTL - PARAMETER LIST STATEMENTS FOLLOW
DEBUG NOABEND,ESTAE
OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL1,SORTIN=SORTI
,DYNALLOC
SORT FIELDS=COPY
ICE201I 0 RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE126A 9 INCONSISTENT OUT1 IFTHEN 0 REFORMATTING FIELD FOUND
ICE052I 3 END OF DFSORT
|
Please help in this regards. |
|
| Back to top |
|
 |
superk
Global Moderator

Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I think this statement:
is the problem and should be changed to:
|
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Mane,
Superk is right.
In both OUTFIL OUTREC operands, you have:
| Code: |
15:3C'33D',
18:1,6,
|
Since 3C'33D' gives you 9 characters, it overlaps the next column you specified (18:). C'33D' will only give you three characters, so it won't overlap the next column.
Given that all of your fields are one after the other, you might want to just drop the column numbers (c:) and let DFSORT figure them out automatically. |
|
| Back to top |
|
 |
Mane Sagar
New User

Joined: 12 Jul 2005 Posts: 41 Location: mumbai
|
|
|
|
Hi,
Thanks a lot Superk and Frank,
I have done the changes and it has worked fine.
Frank can you please ellaborate your last statement on DFSORT.
'Given that all of your fields are one after the other, you might want to just drop the column numbers (c and let DFSORT figure them out automatically'
Does it mean that, if I dnt specify the position in the output file DFSORT will calculate on its own.
Can you also give me the syntax.
Please let me know if I am wrong.
Regds,
Sagar Mane. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
When you reformat records, DFSORT automatically puts each item right after the previous item unless you use c: to tell it not to. So if you used:
| Code: |
OUTREC=(19,5,
24,9,
C'33D',
1,6,
42,11)
|
You would get the same result as if you used:
| Code: |
OUTREC=(01:19,5,
06:24,9,
15:C'33D',
18:1,6,
24:42,11)
|
You can use c: whenever you like, but you really only need it if you are skipping bytes, e.g.
| Code: |
OUTREC=(19,5,
10:24,9)
|
Without the 10:, the second field would start in position 6. With the 10:, it starts in position 10 and blanks are filled in from position 6 to 9. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|