View previous topic :: View next topic
|
Author |
Message |
ppravin47
New User
Joined: 23 Mar 2010 Posts: 17 Location: Bangalore
|
|
|
|
I have 7 digit numeric field in flat file. eg. 0010016
I want to convert this into binary form [S9(9) comp] using DFSORT
Please help. |
|
Back to top |
|
|
ssmukul
New User
Joined: 22 Jan 2008 Posts: 19 Location: India
|
|
|
|
Hi Pravin,
Is there only this numeric field in the flat file? You haven't specified the record length and starting position.
If there is only numeric field then use below sort card.
Code: |
OPTION COPY
OUTREC FIELDS(1,7,ZD,TO=BI,LENGTH=4) |
Thanks, |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hello There,
Please use below sort card
Code: |
OPTION COPY
OUTREC FIELDS=(1,7,ZD,TO=BI,LENGTH=4)
|
|
|
Back to top |
|
|
ppravin47
New User
Joined: 23 Mar 2010 Posts: 17 Location: Bangalore
|
|
|
|
Thanks for the reply.
But When I have given the statements you have specified, the job got abended with code 16 i.e.ICE010A 0 NO SORT OR MERGE CONTROL STATEMENT
So i have given statement
Code: |
SORT FIELDS=COPY
OUTREC FIELDS=(1,7,ZD,TO=BI,LENGTH=4)
END
|
But it is not working it is simply copying those field in to o/p file(Not converting into BI).
Please suggest. |
|
Back to top |
|
|
ssmukul
New User
Joined: 22 Jan 2008 Posts: 19 Location: India
|
|
|
|
Hi Pravin,
Can you please verify that the control statements in SYSIN are given from 2nd column or greater, with OPTION COPY statement.
I guess starting the control statements from 2nd column or after will solve your problem. |
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
ppravin47,
Could you please output you are getting after you ran the above given job?
Thanks, |
|
Back to top |
|
|
ppravin47
New User
Joined: 23 Mar 2010 Posts: 17 Location: Bangalore
|
|
|
|
thanks All of you.
I got the problem.
I have executed job with
Code: |
SORT FIELDS=COPY
OPTION COPY
OUTREC FIELDS=(1,7,ZD,TO=BI,LENGTH=4)
|
It worked fine.
Thanks All |
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
ppravin47,
Why did you specify OPTION COPY and SORT FIELDS=COPY both?
Thanks, |
|
Back to top |
|
|
ppravin47
New User
Joined: 23 Mar 2010 Posts: 17 Location: Bangalore
|
|
|
|
Sorry Friends I had made a small mistake.
Like 1st run I had executed with
Code: |
//*SORT FIELDS=COPY
OPTION COPY
OUTREC FIELDS=(1,7,ZD,TO=BI,LENGTH=4)
|
the job got abended with code 16 i.e.ICE010A 0 NO SORT OR MERGE CONTROL STATEMENT
So I hav removed the comment and tried so it worked fine.
Code: |
SORT FIELDS=COPY
OPTION COPY
OUTREC FIELDS=(1,7,ZD,TO=BI,LENGTH=4)
|
But now i have tried with either of the statement OPTION COPY or SORT FIELDS=COPY like
Code: |
OPTION COPY
OUTREC FIELDS=(1,7,ZD,TO=BI,LENGTH=4)
|
OR
Code: |
SORT FIELDS=COPY
OUTREC FIELDS=(1,7,ZD,TO=BI,LENGTH=4)
|
So both ran successfully.
So I think the problem in 1st execution was the commented statement.
So we should not use any commented statement in DFSORT.
Thanks all of you for your prompt reply. |
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
ppravin47,
Quote: |
So we should not use any commented statement in DFSORT. |
DFSort has its own comment statement. //* is comment for JCL and you had specified that inside your sort control card.
Please Read comment here
Thanks, |
|
Back to top |
|
|
ppravin47
New User
Joined: 23 Mar 2010 Posts: 17 Location: Bangalore
|
|
|
|
@sqlcode1
Thanks For info...!!! |
|
Back to top |
|
|
|