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

vsam to gdg


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

New User


Joined: 17 Feb 2005
Posts: 4

PostPosted: Fri Feb 18, 2005 2:39 pm
Reply with quote

hai!
can any body send me the solution of the following:

i have a Vsam KSDS file 'FILE1', with 10000 records, each having some fields, one of the field is 'FIELD1' of size 10 bytes.

and now i want to read that ksds file records and search for 'indic' string . (this 'indic' is located in last 5 bytes of the 'FIELD1' variable.)

so if u find that in any record then write that record in to other o/p file(gdg), else write in to empty file.

consider it as urgent
with thanks
saru
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: Fri Feb 18, 2005 10:35 pm
Reply with quote

You can use DFSORT to do this. DFSORT can always process a KSDS as TYPE V. DFSORT can process a KSDS as TYPE F if all of the records are the same length.

Let's assume the string you want to check starts in data position 21.

With TYPE V processing, the starting position would be 25 (21 + 4 for the RDW that DFSORT uses) and you could use this DFSORT job to write only the records with the given string to the output data set:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...   VSAM input file
//SORTOUT DD DSN=...  VB output file
//SYSIN DD *
   OPTION COPY
   RECORD TYPE=V
   INCLUDE COND=(25,5,CH,EQ,C'indic')


With TYPE F processing, the starting position would be 21 and you could use this DFSORT job to write only the records with the given string to the output data set:

Code:

//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...   VSAM input file
//SORTOUT DD DSN=...  FB output file
//SYSIN DD *
   OPTION COPY
   RECORD TYPE=F
   INCLUDE COND=(21,5,CH,EQ,C'indic')


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=20050120082820&CASE=

I don't know what you mean by "else write in to empty file.". You need to explain what you mean by this if you want more help. Showing an example of your input recoreds and what you expect for output would be a good way to clarify what you need.
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 Access to non cataloged VSAM file JCL & VSAM 18
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts CVDA value for RRDS VSAM dataset. CICS 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Open VSAM File in IMS DC Region - DFS... IMS DB/DC 0
Search our Forums:

Back to Top