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
 

 

Filtering records based on condtion from VSAM file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Rambhupalchowdary

New User


Joined: 19 Aug 2010
Posts: 47
Location: Hyderabad

PostPosted: Wed Oct 06, 2010 11:42 am    Post subject: Filtering records based on condtion from VSAM file
Reply with quote

Hi,

I want to filter the records from VSAM based on condition and write those to either VSAM or Flat file thru JCL. ( Like filtering records using Include Cond in Sort )

Please let us know, your thoughts.

Thanks,
Ram.
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: Wed Oct 06, 2010 11:49 am    Post subject:
Reply with quote

Once more let us clarify exactly what JCL is.
it is Job Control Language.

By itself it does nothing. It is used to invoke the chosen program and to define which datasets are to be used by the DD names associated with the chosen program.

JCL does not have magical powers that solve all problems, JCL is merely the vehicule for telling the processor which program you want it to execute.

So if you might be so informative to suggest which program you would like your JCL to be executing then perhaps we might be better positioned to assist.
Back to top
View user's profile Send private message
Rambhupalchowdary

New User


Joined: 19 Aug 2010
Posts: 47
Location: Hyderabad

PostPosted: Wed Oct 06, 2010 12:00 pm    Post subject: Reply to: Filtering records based on condtion from VSAM file
Reply with quote

Hi Expat,

Till now i have used IDCAMS, to process VSAM files.
It would be better, if you please provide any solution for my query by using IDCAMS.

Appreciate any other solutions by using any other programs.

Thanks,
Ram.
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: Wed Oct 06, 2010 12:05 pm    Post subject:
Reply with quote

Search the forum for solutions using either DFSORT or SYNCSORT - depending on the product and release level you have installed.

Also, it might be a good idea to supply some useful information
Record length is fixed or variable.
The actual record length (Give both average and maximum if variable)
The position and format of the "filter" field(s)
The rules for including / omitting records
Back to top
View user's profile Send private message
Rambhupalchowdary

New User


Joined: 19 Aug 2010
Posts: 47
Location: Hyderabad

PostPosted: Wed Oct 06, 2010 1:33 pm    Post subject: Reply to: Filtering records based on condtion from VSAM file
Reply with quote

Hi Expat,

Please find below details.

Record length is fixed or variable = Variable
The actual record length (Give both average and maximum if variable) =
RECORDSIZE(31773,32710)
The position and format of the "filter" field(s) = from 5th position 4 bytes
The rules for including / omitting records = include only records have 'aaaa' from 5th position.

Please let me know if you require any further info.

Thanks,
Ram.
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: Wed Oct 06, 2010 1:48 pm    Post subject:
Reply with quote

Are you using SYNCSORT or DFSORT

Please run the code below and post the output from SYSOUT
Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Wed Oct 06, 2010 1:55 pm    Post subject: Reply to: Filtering records based on condtion from VSAM file
Reply with quote

if You had cared to search the jcl/dfsort forums with sort include
You would have found lots of examples
here is one of them
http://ibmmainframes.com/viewtopic.php?t=51341&highlight=sort+include
or
http://ibmmainframes.com/viewtopic.php?t=49018&highlight=
start doing a bit of work Yourself

it would be also useful for you to read and meditate on
How To Ask Questions The Smart Way
http://catb.org/~esr/faqs/smart-questions.html
to make the most out of the questions You ask
Back to top
View user's profile Send private message
Rambhupalchowdary

New User


Joined: 19 Aug 2010
Posts: 47
Location: Hyderabad

PostPosted: Wed Oct 06, 2010 2:20 pm    Post subject: Reply to: Filtering records based on condtion from VSAM file
Reply with quote

Hi Expat/enrico-sorichetti,

We have DFSORT in our shop.

Sorry for the confusion, earlier i had an opinion like we should not copy VSAM to flat file using DFSORT and we should do it using only IDCAMS. Now i did it successfully using DFSORT.

Thanks for your help.

Now my query is how to create VSAM file using DFSORT ? Also please let me know how to view whether the VSAM is VB or FB ?

Thanks,
Ram.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Wed Oct 06, 2010 3:18 pm    Post subject: Reply to: Filtering records based on condtion from VSAM file
Reply with quote

You do not create VSAM files with dfsort

You can create them
by JCL
by IDCAMS define

my advice is to use IDCAMS define

after that You can load data into it using idcams repro or sort
Back to top
View user's profile Send private message
Rambhupalchowdary

New User


Joined: 19 Aug 2010
Posts: 47
Location: Hyderabad

PostPosted: Wed Oct 06, 2010 3:34 pm    Post subject: Reply to: Filtering records based on condtion from VSAM file
Reply with quote

Thanks enrico-sorichetti for your valuable inputs,

If we need to filter few records based on condition from VSAM file and wants to copy those to another VSAM file; Do we have any other solution other than below mentioned ?

step1:- Copy records from VSAM to Flat file based on certian cond using DFSORT.

Step2:- convert the Flat file to VSAM using IDCAMS.

Is there any other solution we can achieve above in single step?

Thanks in advance.
Ram.
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: Wed Oct 06, 2010 3:42 pm    Post subject:
Reply with quote

Define new VSAM cluster
Sort from existing to new VSAM cluster
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Wed Oct 06, 2010 3:42 pm    Post subject: Reply to: Filtering records based on condtion from VSAM file
Reply with quote

sort can read and write VSAM files

step1 IDCAMS delete/define
step2 sort with vsam input and output

to have an absolute one step only solution then the vsam define should be done with jcl allocation/implicit definition
but that' s an approach I would not advice for, since it needs a very sound SMS environment
Back to top
View user's profile Send private message
Rambhupalchowdary

New User


Joined: 19 Aug 2010
Posts: 47
Location: Hyderabad

PostPosted: Wed Oct 06, 2010 4:03 pm    Post subject: Reply to: Filtering records based on condtion from VSAM file
Reply with quote

Thanks a lot for all ur inputs..
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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