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

Sortjoin and Search for a String and remove it in the output


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

New User


Joined: 03 Dec 2007
Posts: 61
Location: Bangalore

PostPosted: Thu Jan 25, 2024 10:37 pm
Reply with quote

Hi All,

I have a file delimited with ;. The position of each values in the file is not fixed. There is a particular string that needs to be completely removed, if a match is found in file

File 1
The String REPLACEME1 or REPLACEME2 when found a hit on file 2, it needs to be removed
Code:

123456789;"B";"ABC012345              ";98745;2;"1";1.23;"REPLACEME";23.12345;
223456789;"B";"ABC012345              ";98;2;"1";1.23;"REPLACEME2";23.12345;
823456789;"B";"ABC012345              ";98745;2;"1";1.23;;23.12345;
923456789;"B";"ABC012345              ";98;2;"1";1.23;"AMGOOD";23.12345;


File 2

Code:

123456789;"B";"REPLACEME"
223456789;"B";"REPLACEME2"


File 1 and File 2 is joined on 1st 9 bytes. If a match is found between File 1 and File 2, then the string found in file 2 (REPLACEME or REPLACEME2) needs to be removed from File1

Output should look like
Code:

123456789;"B";"ABC012345              ";98745;2;"1";1.23;;23.12345;
223456789;"B";"ABC012345              ";98;2;"1";1.23;;23.12345;
823456789;"B";"ABC012345              ";98745;2;"1";1.23;;23.12345;
923456789;"B";"ABC012345              ";98;2;"1";1.23;"AMGOOD";23.12345;


The String that needs to be replaced in File is Not of fixed length and the value can vary. if found in File1, then it needs to be removed.

Appreciate any help on this

Thanks
Sikkandhar
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Fri Jan 26, 2024 2:34 am
Reply with quote

Issue #1:
There are no “files” in mainframe architecture.

“Files” (on most of other platforms) consist of long sequence of bytes. Optionally, text “files” may contain virtual “lines” separated by special bytes CR and/or LF, but it is not a requirement.

In mainframes, the “datasets” mandatory consist of “records”, which consist of bytes, either equal or different amount of them in each record. For text data, each “record” is usually considered also as a “line”, without any additional special byte used to separate the “text lines”.

When data are transferred from Windows/Unix/Apple/etc. to mainframe, one needs to know exactly: how logical strings between CR/LF are converted to physical records on mainframe? Depending on the used conversion method different ways of dataset parsing may be needed.

There is also a good chance that the initial “file” did not include any CR/LF, and hence, on mainframe it can be divided into physical records at random positions! It happens in real life, depending on the qualification of the System Architect.
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top