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

Construct new record using specific field in multiple record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
kanitha

New User


Joined: 23 Nov 2022
Posts: 1
Location: india

PostPosted: Wed Nov 23, 2022 2:47 pm
Reply with quote

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
View user's profile Send private message
RBABU

New User


Joined: 23 Nov 2022
Posts: 5
Location: India

PostPosted: Wed Nov 23, 2022 4:30 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Wed Nov 23, 2022 6:52 pm
Reply with quote

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:
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!
Back to top
View user's profile Send private message
RBABU

New User


Joined: 23 Nov 2022
Posts: 5
Location: India

PostPosted: Thu Nov 24, 2022 10:58 am
Reply with quote

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:
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)
/*
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


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

PostPosted: Thu Nov 24, 2022 1:09 pm
Reply with quote

What error message(s) have you got? I assume HEX,BI,TO=ZD will be reported..
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Thu Nov 24, 2022 5:50 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Thu Nov 24, 2022 5:51 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top