|
|
| Author |
Message |
rajandhla
Active User
Joined: 18 Oct 2005 Posts: 184 Location: Hyderabad
|
|
|
|
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 |
|
 |
References
|
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4684 Location: San Jose, CA
|
|
|
|
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 |
|
 |
rajandhla
Active User
Joined: 18 Oct 2005 Posts: 184 Location: Hyderabad
|
|
|
|
| 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 |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4684 Location: San Jose, CA
|
|
|
|
| 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 |
|
 |
|
|
|