Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Eliminate last occurence in a record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Eliminate last occurence in a record
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

Site Director


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

PostPosted: Thu Jul 04, 2013 12:23 am    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

Moderator


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

PostPosted: Thu Jul 04, 2013 10:26 am    Post subject:
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: 2163
Location: @my desk

PostPosted: Thu Jul 04, 2013 11:01 am    Post subject:
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: 1703
Location: Australia

PostPosted: Thu Jul 04, 2013 11:04 am    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Thu Jul 04, 2013 6:22 pm    Post subject:
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

Site Director


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

PostPosted: Fri Jul 05, 2013 9:32 pm    Post subject:
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

Senior Member


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

PostPosted: Mon Jul 08, 2013 7:50 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us