IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Numeric to binary conversion


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ppravin47

New User


Joined: 23 Mar 2010
Posts: 17
Location: Bangalore

PostPosted: Mon Aug 09, 2010 3:46 pm
Reply with quote

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
View user's profile Send private message
ssmukul

New User


Joined: 22 Jan 2008
Posts: 19
Location: India

PostPosted: Mon Aug 09, 2010 4:01 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Aug 09, 2010 4:03 pm
Reply with quote

Hello There,

Please use below sort card

Code:

  OPTION COPY                             
  OUTREC FIELDS=(1,7,ZD,TO=BI,LENGTH=4)   
Back to top
View user's profile Send private message
ppravin47

New User


Joined: 23 Mar 2010
Posts: 17
Location: Bangalore

PostPosted: Mon Aug 09, 2010 5:08 pm
Reply with quote

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
View user's profile Send private message
ssmukul

New User


Joined: 22 Jan 2008
Posts: 19
Location: India

PostPosted: Mon Aug 09, 2010 5:28 pm
Reply with quote

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
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Mon Aug 09, 2010 6:59 pm
Reply with quote

ppravin47,
Could you please output you are getting after you ran the above given job?

Thanks,
Back to top
View user's profile Send private message
ppravin47

New User


Joined: 23 Mar 2010
Posts: 17
Location: Bangalore

PostPosted: Mon Aug 09, 2010 7:03 pm
Reply with quote

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
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Mon Aug 09, 2010 7:14 pm
Reply with quote

ppravin47,
Why did you specify OPTION COPY and SORT FIELDS=COPY both?

Thanks,
Back to top
View user's profile Send private message
ppravin47

New User


Joined: 23 Mar 2010
Posts: 17
Location: Bangalore

PostPosted: Mon Aug 09, 2010 7:34 pm
Reply with quote

Sorry Friends I had made a small mistake. icon_redface.gif

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. icon_biggrin.gif icon_biggrin.gif


Thanks all of you for your prompt reply. icon_biggrin.gif icon_biggrin.gif icon_biggrin.gif
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Mon Aug 09, 2010 7:49 pm
Reply with quote

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
View user's profile Send private message
ppravin47

New User


Joined: 23 Mar 2010
Posts: 17
Location: Bangalore

PostPosted: Tue Aug 10, 2010 11:20 am
Reply with quote

@sqlcode1


Thanks For info...!!! icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts file manager is doing string conversion IBM Tools 3
No new posts Convert HEX to Numeric DB2 3
Search our Forums:

Back to Top