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

Particular data lies between a range - using DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
NatashaN

New User


Joined: 07 Mar 2022
Posts: 2
Location: India

PostPosted: Tue Mar 08, 2022 1:33 am
Reply with quote

Hi All,

I have 2 files

File 1 - 80 bytes
Prefix low - 8 bytes
Prefix High - 8 bytes
Date - 10 bytes

File 2 - 80 bytes
Card number - 15 bytes

I want the card numbers in output file by checking if that particular card number lies between the low - high prefix or equal.

Attached the files how it looks.

Please guide me how to achieve this using DFSORT.

Thanks in advance,
Natasha
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 1492

PostPosted: Tue Mar 08, 2022 6:23 am
Reply with quote

1. Use Code button instead of attachements to present your cade, and your samples.

2. What is Date field in your output?

3. This task is presented as an example between #5 and #10 in ANY SORT manual. (Hence, you did not read any of manuals)
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


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

PostPosted: Tue Mar 08, 2022 9:24 am
Reply with quote

It can be achieved w/ a JOINKEYS operation and is not very complicated. Find a field that is common in F1 and F2, use that as a key. REFORMAT what fields you need from F1 and F2.
Use OUTFIL to INCLUDE only records that match your criteria.

In case sequence of records should be pertained, add a SEQNUM beforehand. SORT on that seqnum and that's it.

Code:
****** ******************
000001 987563104563856   
000002 234561997654980   
000003 234561007654980   
****** ******************
Back to top
View user's profile Send private message
NatashaN

New User


Joined: 07 Mar 2022
Posts: 2
Location: India

PostPosted: Tue Mar 08, 2022 1:13 pm
Reply with quote

Hi Joerg.Findeisen and sergeyken,

Thanks for the response.

Below is my File 1 - so the prefix ranges value from low to high which is of 8 bytes.
****** *****************************
000001 12345500 12345599 2022-03-07
000002 23456100 23456199 2022-03-07
000003 98756300 98756399 2022-03-07
****** ****************************

Below is file 2 - which contains card number of 15 bytes. So if the first 8 bytes of card number from file 2 falls between low - high range of file 1 then that card number is required in my output.
********************
987563104563856
786512349087675
234561997654980
234561007654980
********************

Not able to achieve this for 2 fields compare range. And the date field is just an additional in file1 which is not required for my operation.


[/code][/quote]
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


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

PostPosted: Tue Mar 08, 2022 5:03 pm
Reply with quote

Please show what you have tried.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 1492

PostPosted: Tue Mar 08, 2022 6:29 pm
Reply with quote

NatashaN wrote:
Hi Joerg.Findeisen and sergeyken,

Thanks for the response.

Below is my File 1 - so the prefix ranges value from low to high which is of 8 bytes.
****** *****************************
000001 12345500 12345599 2022-03-07
000002 23456100 23456199 2022-03-07
000003 98756300 98756399 2022-03-07
****** ****************************

Below is file 2 - which contains card number of 15 bytes. So if the first 8 bytes of card number from file 2 falls between low - high range of file 1 then that card number is required in my output.
********************
987563104563856
786512349087675
234561997654980
234561007654980
********************

Not able to achieve this for 2 fields compare range. And the date field is just an additional in file1 which is not required for my operation.


[/code]


Use Code button to present your code, AND all your samples, including input AND output.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


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

PostPosted: Thu Mar 10, 2022 5:10 am
Reply with quote

I give this one more try. Are prefix ranges value from low to high always starting with the same digit?

No answer means you solved the issue by yourself already. Good then.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Setting CA7 user variable from data s... CA Products 7
No new posts pass data as symbolic parameter from ... CLIST & REXX 2
No new posts How to display the leading zeros of a... DB2 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Decompress data from JMR log file Compuware & Other Tools 4
Search our Forums:

Back to Top