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
 

 

Alter the sequence of records

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

New User


Joined: 17 May 2007
Posts: 8
Location: chennai

PostPosted: Mon Aug 27, 2007 11:52 pm    Post subject: Alter the sequence of records
Reply with quote

Hi,

I need to alter the sequence of records. Below are the input file records:

0000M001A
0000M001B
0000M001C
0000M001D
0000M001E
0000M001F
0000M001G
0000M001H
0000M001I
0000M001J
0000M001K
0000M001L
0000M001M
0000M001Q
0000M001R

0000M001Z
0000M002A
0000M002B
0000M002C
0000M002D
0000M002E
0000M002F
0000M002G
0000M002H
0000M002I
0000M002J
0000M002K
0000M002L
0000M002M
0000M002Q
0000M002R

0000M002Z

and my desired output needs to be as follows:

0000M001A
0000M001B
0000M001C
0000M001D
0000M001E
0000M001F
0000M001G
0000M001H
0000M001I
0000M001J
0000M001K
0000M001L
0000M001M
0000M001Q
0000M001R
0000M001Z
0000M002A
0000M002B
0000M002C
0000M002D
0000M002E
0000M002F
0000M002G
0000M002H
0000M002I
0000M002J
0000M002K
0000M002L
0000M002M
0000M002Z
0000M001Q
0000M001R
0000M002Q
0000M002R


Please help me…

Thanks in advance
Surendra.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 28, 2007 12:05 am    Post subject:
Reply with quote

you need to add an extra field. OVERLAY on INREC

the field to be 0 when value of is not
0000M001Q
0000M001R
0000M002Q
0000M002R

the field to be 1 when value of is
0000M001Q
0000M001R
0000M002Q
0000M002R

Then sort keys would be extra field, normal field

drop the extra field on OUTREC.
Back to top
View user's profile Send private message
surendra_giddaluru

New User


Joined: 17 May 2007
Posts: 8
Location: chennai

PostPosted: Tue Aug 28, 2007 12:33 am    Post subject:
Reply with quote

Hi,

Thanks for your reply. I need to bring down all the 'Q' and 'R' records at the end of all records. For example if have another account records like

0000M003A
0000M003B
0000M003C
0000M003D
0000M003E
0000M003F
0000M003G
0000M003H
0000M003I
0000M003J
0000M003K
0000M003L
0000M003M
0000M003Q
0000M003R
0000M003Z

then my output should be

0000M001A
0000M001B
0000M001C
0000M001D
0000M001E
0000M001F
0000M001G
0000M001H
0000M001I
0000M001J
0000M001K
0000M001L
0000M001M
0000M001Q
0000M001R
0000M001Z
0000M002A
0000M002B
0000M002C
0000M002D
0000M002E
0000M002F
0000M002G
0000M002H
0000M002I
0000M002J
0000M002K
0000M002L
0000M002M
0000M002Z
0000M003A
0000M003B
0000M003C
0000M003D
0000M003E
0000M003F
0000M003G
0000M003H
0000M003I
0000M003J
0000M003K
0000M003L
0000M003M
0000M003Z
0000M001Q
0000M001R
0000M002Q
0000M002R
0000M003Q
0000M003R


Please let me kno if you need any more clarification.

Thanks,
Surendra.
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: Tue Aug 28, 2007 12:47 am    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=..  input file (FB/80)
//SORTOUT DD DSN=..  output file (FB/80)
//SYSIN DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'0')),
    IFTHEN=(WHEN=(9,1,SS,EQ,C'QR'),OVERLAY=(81:C'1'))
  SORT FIELDS=(81,1,CH,A,1,9,CH,A)
  OUTREC BUILD=(1,80)
/*
Back to top
View user's profile Send private message
surendra_giddaluru

New User


Joined: 17 May 2007
Posts: 8
Location: chennai

PostPosted: Tue Aug 28, 2007 7:49 pm    Post subject:
Reply with quote

Hi Frank,

Thank you!!!

Thanks,
Surendra.
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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