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
 

 

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

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

New User


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

PostPosted: Mon Feb 02, 2009 1:26 pm    Post subject: Can we change VSAM file Record sequence by using any tool??
Reply with quote

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

dick scherrer

Site Director


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

PostPosted: Mon Feb 02, 2009 1:30 pm    Post subject:
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: 19
Location: Pune (India)

PostPosted: Mon Feb 02, 2009 1:46 pm    Post subject: Hi
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

Site Director


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

PostPosted: Mon Feb 02, 2009 1:49 pm    Post subject:
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: 19
Location: Pune (India)

PostPosted: Mon Feb 02, 2009 1:54 pm    Post subject:
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

Site Director


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

PostPosted: Mon Feb 02, 2009 8:34 pm    Post subject:
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: 7936
Location: Bellevue, IA

PostPosted: Mon Feb 02, 2009 8:40 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Feb 02, 2009 8:40 pm    Post subject:
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 Moderator


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

PostPosted: Tue Feb 03, 2009 12:10 am    Post subject:
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    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 Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts Underlying DB2 VSAM LDS - SMF recording vasanthz All Other Mainframe Topics 6 Thu Jan 05, 2017 4:20 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm


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