# Construct new record using specific field in multiple record

Author Message
kanitha

New User

Joined: 23 Nov 2022
Posts: 1
Location: india

 Posted: Wed Nov 23, 2022 2:47 pm 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
RBABU

New User

Joined: 23 Nov 2022
Posts: 5
Location: India

 Posted: Wed Nov 23, 2022 4:30 pm 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
sergeyken

Senior Member

Joined: 29 Apr 2008
Posts: 1884
Location: USA

Posted: Wed Nov 23, 2022 6:52 pm

RBABU wrote:

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:
 Code: 79397604 79344960

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!
RBABU

New User

Joined: 23 Nov 2022
Posts: 5
Location: India

Posted: Thu Nov 24, 2022 10:58 am

sergeyken wrote:
RBABU wrote:

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:
 Code: 79397604 79344960

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)
/*
Joerg.Findeisen

Senior Member

Joined: 15 Aug 2015
Posts: 1138
Location: Bamberg, Germany

 Posted: Thu Nov 24, 2022 1:09 pm What error message(s) have you got? I assume HEX,BI,TO=ZD will be reported..
Rohit Umarjikar

Global Moderator

Joined: 21 Sep 2010
Posts: 3014
Location: NYC,USA

Posted: Thu Nov 24, 2022 5:50 pm

 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.
Rohit Umarjikar

Global Moderator

Joined: 21 Sep 2010
Posts: 3014
Location: NYC,USA

Posted: Thu Nov 24, 2022 5:51 pm

 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.
 View Bookmarks All times are GMT + 6 Hours

 Topic Forum Replies Similar Topics How to append a PS file into multiple... JCL & VSAM 3 Need help to append a date&tsp at... DFSORT/ICETOOL 9 Join multiple records using splice DFSORT/ICETOOL 5 Build a record in output file and rep... DFSORT/ICETOOL 11 getting subtotals for multiple sections SYNCSORT 4
Search our Forums:

 IBMMainframes.com is not an official and/or affiliated with IBM® in anyway Board Rules | FAQ | Downloads | Wiki | SiteMap | Contact Us