Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Problem with conversion of numeric data to other format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Mon Dec 19, 2005 4:59 pm    Post subject: Problem with conversion of numeric data to other format
Reply with quote

Hi All,

I have received a file stored which consist second byte is in internal format
the record looks as S AAAAEVA. when i do hex on on command prompt the record looks as
S AAAAEVA
E0CCCCCEC
261111551

But now i want second byte to be display as normal numeric integer
and the record should look as S06AAAAEVA.

Can any body please help me to sort out using sort utility.

i used OUTREC FIELDS=(1,1,2,1,FI,TO=ZD) AND WITH VARIOUS OPTIONS.

Thanks In Advance.

Regards
Jai
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Dec 19, 2005 9:09 pm    Post subject:
Reply with quote

Since you show only two digits for the converted byte, I'm going to assume it's an unsigned binary value that can only go from X'00'-X'63' (0-99). I'm also assuming your input file has RECFM=FB and LRECL=80. Given that, you can use the following DFSORT job to do what you asked for. Note that the output data set will have LRECL=81 because you're going from a 1-byte BI field (X'06') to a 2-byte character field C'06').

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/81)
//SYSIN    DD    *
  OPTION COPY
  OUTREC FIELDS=(1,1,2,1,BI,EDIT=(TT),3,78)
/*


If you want something else, please be very specific about what you want.
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Tue Dec 20, 2005 5:53 pm    Post subject:
Reply with quote

Frank Yaeger wrote:
Since you show only two digits for the converted byte, I'm going to assume it's an unsigned binary value that can only go from X'00'-X'63' (0-99). I'm also assuming your input file has RECFM=FB and LRECL=80. Given that, you can use the following DFSORT job to do what you asked for. Note that the output data set will have LRECL=81 because you're going from a 1-byte BI field (X'06') to a 2-byte character field C'06').

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/81)
//SYSIN    DD    *
  OPTION COPY
  OUTREC FIELDS=(1,1,2,1,BI,EDIT=(TT),3,78)
/*


If you want something else, please be very specific about what you want.

Many Thanks,
Frank Yaeger.

This is another requirement but iam afarid whether it can be handled with sort or not. i have done by writing cobol program.
i will get file from external system with date as internal format.when we do hex on the command prompt at date positions i will see as D2CF, the value of it is 26JUL05. Can we convert the date using sort utility.
If yes please let me know.

Thanks In Adavance.
Jai
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Dec 20, 2005 10:21 pm    Post subject:
Reply with quote

I can't tell you whether DFSORT can do this until you tell me the method (algorithm) for converting from one form of the date to the other - I have no idea what method you're using to convert X'D2CF' to 26JUL05.
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 tool to compare numeric data balaji81_k Compuware & Other Tools 0 Tue Sep 26, 2017 3:35 am
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us