Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Numeric to binary conversion

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Numeric to binary conversion
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    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Mon Aug 09, 2010 4:03 pm    Post subject:
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    Post subject: Reply to: Numeric to binary conversion
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    Post subject:
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: 578
Location: USA

PostPosted: Mon Aug 09, 2010 6:59 pm    Post subject:
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    Post subject: Reply to: Numeric to binary conversion
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: 578
Location: USA

PostPosted: Mon Aug 09, 2010 7:14 pm    Post subject:
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    Post subject: Reply to: Numeric to binary conversion
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: 578
Location: USA

PostPosted: Mon Aug 09, 2010 7:49 pm    Post subject:
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    Post subject: Reply to: Numeric to binary conversion
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Conversion of a VB file to FB. isssal DFSORT/ICETOOL 1 Mon Oct 31, 2016 10:23 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts EBCDIC to ASCII conversion using OCOPY mistah kurtz All Other Mainframe Topics 5 Tue Sep 06, 2016 2:26 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us