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: 1650

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

Active Member


Joined: 15 Aug 2015
Posts: 940
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: 2963
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: 2963
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 S0C7 - Field getting overlayed COBOL Programming 2
No new posts Extract record using 2 input file int... JCL & VSAM 2
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
No new posts I want to append a record in an exist... CLIST & REXX 17
No new posts Count the number of characters in a f... CA Products 1
Search our Forums:

Back to Top