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

Eliminate last occurence in a record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sun_job

New User


Joined: 18 Sep 2007
Posts: 73
Location: Bangalore

PostPosted: Wed Jul 03, 2013 11:42 pm
Reply with quote

My input file contains
ABC 003,003
FEG 003,003
BNG 003,003
TNG 003,003

output
ABC 003
FEG 003
BNG 003
TNG 003

Need to eliminate the last 4 bytes? i want to use sort, any help is appreciated
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 04, 2013 12:23 am
Reply with quote

Hello,

OVERLAY those 4 bytes with spaces,
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Jul 04, 2013 12:32 am
Reply with quote

Just a few minor questions:

What is the file format and record length of the input file?
What is the file format and record length of the output file?
What sort product and version?
Back to top
View user's profile Send private message
sun_job

New User


Joined: 18 Sep 2007
Posts: 73
Location: Bangalore

PostPosted: Thu Jul 04, 2013 9:47 am
Reply with quote

Craq Giegerich wrote:
Just a few minor questions:

What is the file format and record length of the input file?
What is the file format and record length of the output file?
What sort product and version?


1. I/P file
File format FB RecL= 50
2. O/P file
File format FB Recl = 54
3. Not sure of version
Back to top
View user's profile Send private message
sun_job

New User


Joined: 18 Sep 2007
Posts: 73
Location: Bangalore

PostPosted: Thu Jul 04, 2013 9:54 am
Reply with quote

Just curious to know, will the NODUPS logic work here
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Jul 04, 2013 10:26 am
Reply with quote

Does Syncsort support Parse?

Or evrn Outrec should do the trick
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jul 04, 2013 11:01 am
Reply with quote

Quote:
Just curious to know, will the NODUPS logic work here
sun_job,

Your example shows no duplicate removal. Why to go around the NODUPS when dick has already directed you in the right path.

And for the sort version, it will be there on the top of SYSOUT of any sort step execution.

Pandora,

Syncsort supports PARSE from 1.3 itself.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Jul 04, 2013 11:04 am
Reply with quote

Hi,

this thread is going nowhere fast.

We don't know what sort product, then we throw in NODUPS, we need to eliminate the last 4 bytes and we end up with an output 4 bytes longer than the input.

Now I have another question, are the last 4 bytes always in position 8-11 ?

Are the extra 4 bytes for the output file just spaces ?


Gerry
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Jul 04, 2013 6:22 pm
Reply with quote

sun_job wrote:
Craq Giegerich wrote:

What sort product and version?

3. Not sure of version

Run the following job:
Code:
//S1 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DUMMY
//SYSIN   DD   *
  OPTION COPY
/*

Copy and paste the SYSOUT sysout here, enclosed in Code tags (quote this post to see what I mean if you don't know). This will allow us to determine what sort product you have, and its level.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jul 05, 2013 9:32 pm
Reply with quote

Hello,

When i originally read this, i understood the last 4 should be spaced out. Possibly my mistake.

With the "clarification" i don't understand how the lrecl grew icon_confused.gif Supposedly, 4 bytes were spaced/removed. From 50 to 54?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Jul 08, 2013 7:50 pm
Reply with quote

To confuse it more, is not it as simple as this Job is:
Code:
//STEP010  EXEC PGM=SORT             
//SYSOUT   DD SYSOUT=*               
//SORTIN   DD *                       
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
ABC 003,003                           
FEG 003,003                           
BNG 003,003                           
TNG 003,003                           
//SORTOUT  DD DSN=HLQ.CONFSING.OUTPUT,
//         DISP=(NEW,CATLG,DELETE),   
//         SPACE=(TRK,(1,1),RLSE)     
//SYSIN    DD *                       
  OPTION COPY                         
  OUTREC FIELDS=(1,7,54:X)           
//*                                   
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
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 To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top