Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Sequence number in SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Rajesh1979

New User


Joined: 24 Dec 2007
Posts: 9
Location: Chennai

PostPosted: Sat Apr 24, 2010 3:59 pm    Post subject: Sequence number in SORT
Reply with quote

Hi,

I want the header record to be skipped while adding the sequence no at the end of the file.
The header file should be copied as it is from input file.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8620
Location: Back in jolly old England

PostPosted: Sat Apr 24, 2010 4:09 pm    Post subject:
Reply with quote

What are the attributes of the input file
DSORG, RECFM, LRECL
Back to top
View user's profile Send private message
Rajesh1979

New User


Joined: 24 Dec 2007
Posts: 9
Location: Chennai

PostPosted: Sat Apr 24, 2010 4:27 pm    Post subject:
Reply with quote

RECFM=FB,LRECL=381,DSORG=PS
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Sat Apr 24, 2010 11:16 pm    Post subject: Re: Sequence number in SORT
Reply with quote

Rajesh1979 wrote:
Hi,

I want the header record to be skipped while adding the sequence no at the end of the file.
The header file should be copied as it is from input file.


Rajesh, What you are trying to ask is not at all clear.

Can you please show us sample example for what you want.
Back to top
View user's profile Send private message
Rajesh1979

New User


Joined: 24 Dec 2007
Posts: 9
Location: Chennai

PostPosted: Sun Apr 25, 2010 8:13 am    Post subject:
Reply with quote

Sambhaji,

Here is some sample layout of input.


HEADER123
WWW3234232
XXX43432432
YYY13123213
ZZZ33123232


Incorrect Output file:

HEADER123 01
WWW323423202
XXX4343243203
YYY1312321304
ZZZ3312323205

Desired Output file:

HEADER123
WWW323423201
XXX4343243202
YYY1312321303
ZZZ3312323204

with sequence no 01,03,03,04,05 added at the end of record.

But I dont want any sequence number for header record HEADER123.
The header record should be written in the output file with out any sequence number.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Apr 26, 2010 11:54 am    Post subject:
Reply with quote

Assumed INPUT LRECL=15 and
Code:

//S1    EXEC  PGM=SORT                                             
//SORTIN DD *                                                       
HEADER123                                                           
WWW3234232                                                         
XXX43432432                                                         
YYY13123213                                                         
ZZZ33123232                                                         
//SORTOUT DD SYSOUT=*                                               
//SYSOUT    DD  SYSOUT=*                                           
//SYSIN    DD  *                                                   
  SORT FIELDS=COPY                                                 
  INREC IFTHEN=(WHEN=(1,6,CH,NE,C'HEADER'),OVERLAY=(16:SEQNUM,4,ZD))
  OUTFIL BUILD=(1,19)                                               
/*                                                                 

Output will be:
Code:

HEADER123                     
WWW3234232     0001           
XXX43432432    0002           
YYY13123213    0003           
ZZZ33123232    0004           
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Apr 26, 2010 10:44 pm    Post subject:
Reply with quote

I believe this DFSORT solution more closely fits the description of what's wanted, but adjust as needed.

Code:

//S1    EXEC  PGM=SORT                                               
//SYSOUT    DD  SYSOUT=*                                             
//SORTIN DD DSN=...  input file (FB/381)                           
//SORTOUT DD DSN=...  output file (FB/383)       
//SYSIN    DD  *                                                     
  OPTION COPY                                                         
  INREC IFTHEN=(WHEN=(1,6,CH,NE,C'HEADER'),
      OVERLAY=(382:SEQNUM,2,ZD))
/*                                                                   
Back to top
View user's profile Send private message
Rajesh1979

New User


Joined: 24 Dec 2007
Posts: 9
Location: Chennai

PostPosted: Tue Apr 27, 2010 12:34 pm    Post subject:
Reply with quote

Thanks Sambhaji and Frank.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us