|
View previous topic :: View next topic
|
| Author |
Message |
joe
New User
Joined: 09 Aug 2005 Posts: 1
|
|
|
|
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 |
|
 |
vijayamadhuri
Active User
Joined: 06 Apr 2005 Posts: 180
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| 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:
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|