View previous topic :: View next topic
|
Author |
Message |
kanitha
New User
Joined: 23 Nov 2022 Posts: 1 Location: india
|
|
|
|
Hi,
Is below transformation possible using sort ? Kindly help.
Input
Name1 Math 90
Name1 Eng 70
Name1 Tam 80
Name1 Sci 95
Name2 Math 80
Name2 sci 95
Output
Name1 90 70 80 95
Name2. 80 95 |
|
Back to top |
|
 |
RBABU
New User
Joined: 23 Nov 2022 Posts: 5 Location: India
|
|
|
|
Hi Team, Please help with the below requirement using sort/icetool.
Sort input file(len=996, rec count=100).
Position 1 to 670 data in alpha numeric.
check @position 671 for number of counts. If entries greater than 0 then proceed to extract data.
If count is 2 then extract data from 2 positions
if count is 3 then extract data from 3 positions
If count is 0 then just move spaces.
Input file in Hex format:
00000B8E4440BB44440000444
02004B240004A500000000000
Infile record given sample data starting from position 671 (hex format)
pos 671 to 672 in hex, the decimal value is 2(count)
pos 675 to 679 in hex, the decimal value is 79397604
pos 682 to 686 in hex, the decimal value is 79344960
There are spaces between 2 values, just ignore.
sortout file looks like:
79397604 79344960 |
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 1884 Location: USA
|
|
|
|
RBABU wrote: |
Hi Team, Please help with the below requirement using sort/icetool.
Sort input file(len=996, rec count=100).
Position 1 to 670 data in alpha numeric.
check @position 671 for number of counts. If entries greater than 0 then proceed to extract data.
If count is 2 then extract data from 2 positions
if count is 3 then extract data from 3 positions
If count is 0 then just move spaces.
Input file in Hex format:
Code: |
00000B8E4440BB44440000444
02004B240004A500000000000
|
Infile record given sample data starting from position 671 (hex format)
pos 671 to 672 in hex, the decimal value is 2(count)
pos 675 to 679 in hex, the decimal value is 79397604
pos 682 to 686 in hex, the decimal value is 79344960
There are spaces between 2 values, just ignore.
sortout file looks like:
|
1. Learn how to use the Code button
2. Do not tailgate your own questions to another one.
3. Your question is 100% your own job, which you are paid for. You job is: ability to think with your own mind, and not copy-and-paste the solution created by others! |
|
Back to top |
|
 |
RBABU
New User
Joined: 23 Nov 2022 Posts: 5 Location: India
|
|
|
|
sergeyken wrote: |
RBABU wrote: |
Hi Team, Please help with the below requirement using sort/icetool.
Sort input file(len=996, rec count=100).
Position 1 to 670 data in alpha numeric.
check @position 671 for number of counts. If entries greater than 0 then proceed to extract data.
If count is 2 then extract data from 2 positions
if count is 3 then extract data from 3 positions
If count is 0 then just move spaces.
Input file in Hex format:
Code: |
00000B8E4440BB44440000444
02004B240004A500000000000
|
Infile record given sample data starting from position 671 (hex format)
pos 671 to 672 in hex, the decimal value is 2(count)
pos 675 to 679 in hex, the decimal value is 79397604
pos 682 to 686 in hex, the decimal value is 79344960
There are spaces between 2 values, just ignore.
sortout file looks like:
|
1. Learn how to use the Code button
2. Do not tailgate your own questions to another one.
3. Your question is 100% your own job, which you are paid for. You job is: ability to think with your own mind, and not copy-and-paste the solution created by others! |
I have written sort card and having issues with the output data. Can you please help on this
//SORTIN DD DSN=INFPUT FILE
//SORTOUT DD DSN - OUTPUT FILE
//SYSIN DD *
OPTION COPY
INCLUDE COND = (671,2 CH,GE'C'2)
OUTREC BUILD=(575,4,HEX,1X,582,4,HEX,BI,TO=ZD)
/* |
|
Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1138 Location: Bamberg, Germany
|
|
|
|
What error message(s) have you got? I assume HEX,BI,TO=ZD will be reported.. |
|
Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3014 Location: NYC,USA
|
|
|
|
kanitha wrote: |
Hi,
Is below transformation possible using sort ? Kindly help.
Input
Name1 Math 90
Name1 Eng 70
Name1 Tam 80
Name1 Sci 95
Name2 Math 80
Name2 sci 95
Output
Name1 90 70 80 95
Name2. 80 95 |
Welcome!
Please make a use of code tags and search before posting as this has been discussed multiple times earlier.
Try and twist - ibmmainframes.com/about23551.html |
|
Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3014 Location: NYC,USA
|
|
|
|
RBABU wrote: |
Hi Team, Please help with the below requirement using sort/icetool.
Sort input file(len=996, rec count=100).
Position 1 to 670 data in alpha numeric.
check @position 671 for number of counts. If entries greater than 0 then proceed to extract data.
If count is 2 then extract data from 2 positions
if count is 3 then extract data from 3 positions
If count is 0 then just move spaces.
Input file in Hex format:
00000B8E4440BB44440000444
02004B240004A500000000000
Infile record given sample data starting from position 671 (hex format)
pos 671 to 672 in hex, the decimal value is 2(count)
pos 675 to 679 in hex, the decimal value is 79397604
pos 682 to 686 in hex, the decimal value is 79344960
There are spaces between 2 values, just ignore.
sortout file looks like:
79397604 79344960 |
Please start your own post with proper code tags and avoid tailgating others post. |
|
Back to top |
|
 |
|