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

Problem with conversion of numeric data to other format


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Mon Dec 19, 2005 9:09 pm
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
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 Developer


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

PostPosted: Tue Dec 20, 2005 10:21 pm
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 All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Format data from multiple records usi... SYNCSORT 4
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts Structured Data and Nested Loops via ... COBOL Programming 0
No new posts IBM IMU Utility for Easytrieve Code t... IBM Tools 0
No new posts Alternate key data extracttion COBOL Programming 13
Search our Forums:


Back to Top