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

Alter the sequence of records


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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 Developer


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

PostPosted: Tue Aug 28, 2007 12:47 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts DROP & ALTER PARTITION-PBR DB2 0
Search our Forums:

Back to Top