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
 

 

Copying to a VSAM file using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Copying to a VSAM file using SORT
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    Post subject: HI
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 Moderator


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

PostPosted: Tue Aug 09, 2005 9:18 pm    Post subject:
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:

http://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    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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm


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