View previous topic :: View next topic
|
Author |
Message |
vishal.iitr2003 Currently Banned New User
Joined: 25 Jan 2008 Posts: 18 Location: India
|
|
|
|
I am trying to sort 1 field which is in S9(9)comp format showing 4 bytes in my PS file. i need to convert it to alphanumeric n copy those records in the end of the file.
Can i do this using syncsort.
Kindly suggest other methods as well.
Field length position is 75 and length 4.
And total file lengt is 156. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Do you mean that you want to take the 4 byte field at position 75 of the record, convert this field into alphanumeric, and then append this to the end of the record rather than the end of the file ? |
|
Back to top |
|
|
vishal.iitr2003 Currently Banned New User
Joined: 25 Jan 2008 Posts: 18 Location: India
|
|
|
|
yes we can say i need to put the converted record in a new field. its not necessary i put it end of record only. But i dont have to replace it. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Similar topics have been discussed on the forum, so why not search through here and DFSort and get some hints and tips and give it a go. |
|
Back to top |
|
|
vishal.iitr2003 Currently Banned New User
Joined: 25 Jan 2008 Posts: 18 Location: India
|
|
|
|
i have been trying....its urgent i thought i shal also put up a new post...... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
I am a DFSORT user ............. |
|
Back to top |
|
|
shankar.v
Active User
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
|
|
|
|
Hi vishal.iitr2003,
Please check with the following code for your requirement.
Code: |
// EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INFILE,DISP=SHR
//SORTOUT DD DSN=OUTFILE,DISP=(,CATLG),
// LRECL=166,RECFM=F,SPACE=(CYL,1)
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,156,75,4,BI,EDIT=(SIIIIIIIII),SIGNS=(+,-))
/*
// |
Thanks,
Shankar |
|
Back to top |
|
|
vishal.iitr2003 Currently Banned New User
Joined: 25 Jan 2008 Posts: 18 Location: India
|
|
|
|
Now i m able to convert the comp filed to numeric field. But the problem i am still facing is that i dont know how to place the records at some new postion.
ie. the column that i am changing is havin 75 position and after converting the data type i want to place it to 25th position so that it gets into a fields having appropriate data definition from the copybook, in the output file.
I tried to find it in previouslydiscussed forums but was unable to find any example of this type......
Kindly suggest some solution or some helpful link will also be handy. |
|
Back to top |
|
|
vishal.iitr2003 Currently Banned New User
Joined: 25 Jan 2008 Posts: 18 Location: India
|
|
|
|
the basic reason i want to do this is because i want to carryon further operations after data type conversion is done. If I let it be at that position only it will hinder the subsequent operations. |
|
Back to top |
|
|
shankar.v
Active User
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
|
|
|
|
Hi vishal.iitr2003,
Please show some example records of how your input and output fields looks, so as to suggest you solutions.
The following code may be help you.
Code: |
// EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INFILE,DISP=SHR
//SORTOUT DD DSN=OUTFILE,DISP=(,CATLG),
// LRECL=166,RECFM=F,SPACE=(CYL,1)
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,24,75,4,BI,EDIT=(SIIIIIIIII),SIGNS=(+,-),25,132)
/*
// |
Thanks,
Shankar |
|
Back to top |
|
|
|