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

Copying to a VSAM file using SORT


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

New User


Joined: 09 Aug 2005
Posts: 1

PostPosted: Tue Aug 09, 2005 6:47 pm
Reply with quote

I tried to copy a few records from a VSAM file to another VSAM file using SORT. But the copying didn't happen. I tried the same sort card with output as a sequential dataset and it worked. There is an include condition in the Sort step , but that is not the key . They key is from 2 to 28 which I have specified in SORT FIELDS=(2,28,CH,A)

Below is the step for the same

//STEP03 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=INPUT-FILE
//SORTOUT DD DSN=OUTPUT-KSDS-FILE,DISP=OLD
//SYSIN DD *
SORT FIELDS=(2,28,CH,A)
INCLUDE COND=(32,6,CH,EQ,C'GCXNHW',OR,32,6,CH,EQ,C'GC3KXX',OR,
32,6,CH,EQ,C'GC3KXR',OR,32,6,CH,EQ,C'GNGK8Q',OR,
32,6,CH,EQ,C'GNGPDD',OR,32,6,CH,EQ,C'GC5J4V')

Please pour in your valuable thoughts
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Tue Aug 09, 2005 9:09 pm
Reply with quote

I think it is not possible to use sort on a vsam dataset.U first have to copy the vsam into flat file using repro then use sort and copy it back to vsam.



If I am wrong please comment.
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 09, 2005 9:18 pm
Reply with quote

Quote:
But the copying didn't happen.


This doesn't tell us anything. Did you get an error message? If so, which error message?

You didn't give any details, so I can only guess at what happened.

When you specify a VSAM input file and VSAM output file, DFSORT uses TYPE=V by default. That means it adds an RDW temporarily to each input record, so your first data byte starts at position 5 (after the 4-byte RDW) rather than at position 1. Thus, you need to add 4 to each starting position. So the starting position for the key would be 6 instead of 2, and the starting position for your INCLUDE field would be 36 instead of 32.

When you specify a VSAM input file and a sequential output file (without RECFM=x), DFSORT uses TYPE=F by default, so your first data byte starts at position 1 and 2 and 32 are the correct starting positions.

So for VSAM in to VSAM out, you can either let DFSORT use TYPE=V by default, and add 4 to your starting positions, or if appropriate you can specify:

Code:

    RECORD TYPE=F


to tell DFSORT to use TYPE=F in which case you don't have to add 4 to your starting positions.

For more information on processing VSAM data sets with DFSORT, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA10/1.8.3.4?SHELF=&DT=20050222160456&CASE=
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
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