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
 
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: 6968
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 Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am

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