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

Can we change VSAM file Record sequence by using any tool??


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dilipbiradar

New User


Joined: 12 Jan 2007
Posts: 18
Location: Pune (India)

PostPosted: Mon Feb 02, 2009 1:26 pm
Reply with quote

Thanks in advance!!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Feb 02, 2009 1:30 pm
Reply with quote

Hello,

It is not clear what you are asking.

Post some sample existing data and how you want it to be to meet your requirement.
Back to top
View user's profile Send private message
dilipbiradar

New User


Joined: 12 Jan 2007
Posts: 18
Location: Pune (India)

PostPosted: Mon Feb 02, 2009 1:46 pm
Reply with quote

I have following records for each Account Number

Code:

Account Number1 A 321
Account Number1 B 124
Account Number1 C 453
Account Number1 D 101
Account Number1 D 901
Account Number2 A 321
Account Number2 B 124
Account Number2 C 453
Account Number2 D 101
Account Number2 D 901


I need to copy this file in the new file but I want the D type reord reversed i. e. D101 must come after D901, I have put sample data, I dont see any field on which I can sort the same.

Please help !! Thanks !!!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Feb 02, 2009 1:49 pm
Reply with quote

Hello,

How complete is the sample data? From the data posted, you could sort the account number and the alpha field ascending and the 3-digit field descending and this would invert the 101/901 entries.
Back to top
View user's profile Send private message
dilipbiradar

New User


Joined: 12 Jan 2007
Posts: 18
Location: Pune (India)

PostPosted: Mon Feb 02, 2009 1:54 pm
Reply with quote

Scenario is I am not supposed to change the sequence of the remaining records other than D

Code:

Account Number1 C 321
Account Number1 A 124
Account Number1 B 453
Account Number1 D 101
Account Number1 D 901
Account Number2 C 21
Account Number2 A 124
Account Number2 B 453
Account Number2 D 101
Account Number2 D 901


Thanks!!!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Feb 02, 2009 8:34 pm
Reply with quote

Hello,

Sorry - didn't realize that the "other" data needed to stay in the same sequence. . .
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Mon Feb 02, 2009 8:40 pm
Reply with quote

If this is a VSAM KSDS file, the key sequence defined in IDCAMS will be used no matter what you want. You can read the data out of the VSAM file, sort it any way you want, and proceed -- but the data sequence in the file is based on the key definition.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Feb 02, 2009 8:40 pm
Reply with quote

Do the fields that you want to change constitute part of the record key ?
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 Feb 03, 2009 12:10 am
Reply with quote

dilipbiradar,

Assuming the output file is NOT a KSDS and the VSAM input file has fixed-length 21 byte records, you can use a DFSORT job like the following to do what you asked for. The job could be changed appropriately if the length of the records is not 21 bytes.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  VSAM input file w/21-byte records
//SORTOUT DD DSN=... output file
//SYSIN    DD    *
  RECORD TYPE=F
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(22:SEQNUM,8,ZD,
    30:SEQNUM,8,ZD,START=0,RESTART=(17,1))),
   IFTHEN=(WHEN=(17,1,CH,EQ,C'D'),
     OVERLAY=(22:22,8,ZD,SUB,30,8,ZD,TO=ZD,LENGTH=8))
  SORT FIELDS=(22,8,ZD,A,19,3,CH,A)
  OUTREC BUILD=(1,21)
/*

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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top