View previous topic :: View next topic
|
Author |
Message |
Rambhupalchowdary
New User
Joined: 19 Aug 2010 Posts: 47 Location: Hyderabad
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
Rambhupalchowdary
New User
Joined: 19 Aug 2010 Posts: 47 Location: Hyderabad
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
Rambhupalchowdary
New User
Joined: 19 Aug 2010 Posts: 47 Location: Hyderabad
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
Back to top |
|
|
Rambhupalchowdary
New User
Joined: 19 Aug 2010 Posts: 47 Location: Hyderabad
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
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 |
|
|
Rambhupalchowdary
New User
Joined: 19 Aug 2010 Posts: 47 Location: Hyderabad
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Define new VSAM cluster
Sort from existing to new VSAM cluster |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
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 |
|
|
Rambhupalchowdary
New User
Joined: 19 Aug 2010 Posts: 47 Location: Hyderabad
|
|
|
|
Thanks a lot for all ur inputs.. |
|
Back to top |
|
|
|