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
 

 

Extract Records From Dataset
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Kumaresan.nk

New User


Joined: 22 Mar 2010
Posts: 31
Location: Chennai

PostPosted: Tue Mar 30, 2010 10:53 am    Post subject: Extract Records From Dataset
Reply with quote

Hi,

I have a address dataset from which i have to extract records of one particular state. But the state name does not fall under a specific column. Following is the format of records -

0000000000001.....SBENJAMIN MUNIZ ROLDOS 1795 CALLE ALCALA SAN JUAN, PR
0000001002358.....EJIM GULALO 41 HATTERTOWN RD Newtown, CT

In the above data - PR and CT are the state name. Please help me to get this done.

deleted the attachment and inlined the sample data

Code:
0000000000001.....SBENJAMIN MUNIZ ROLDOS                   1795 CALLE ALCALA                  SAN JUAN, PR
0000001002358.....EJIM GULALO                              41 HATTERTOWN RD                   Newtown, CT
0000001010001.....EPHYSICIANS REGIONAL MEDICAL             6101 PINE RIDGE ROAD               NAPLES, FL
0000001011352.....EHELEN M KOCH                            LAS PALMAS UNIT 478                215 NORTH POWER RD.                     MESA, AZ
0000001033580.....EHEALTH INSURANCE ASSOC LLP              565 WASHINGTON AVE                 NORTH HAVEN, CT

do not post attachments, not everybody can see/download them
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: Tue Mar 30, 2010 12:06 pm    Post subject:
Reply with quote

Please do not use attachments as not everybody can use them, thus reducing the number of people able to help you.

Search the forum, and if you use DFSORT, search for SS. Not sure if this is supported using SYNCSORT. There are examples on the forum to determine both the sort product and its release level. PLease check this out and post the results.
Back to top
View user's profile Send private message
km_abdullah

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Tue Mar 30, 2010 12:14 pm    Post subject:
Reply with quote

Hi,

SYNCSORT also supports 'SS' parameter atleast for release
SYNCSORT FOR Z/OS 1.3.2.1R
Back to top
View user's profile Send private message
SCARCEBOYZ

New User


Joined: 16 May 2005
Posts: 32
Location: Millenium Business Park, Mumbai

PostPosted: Tue Mar 30, 2010 4:24 pm    Post subject:
Reply with quote

Hi Kumaresan,

Welcome to the group.

Try this

Code:

//SYSIN    DD *
        SORT    FIELDS=COPY
        INCLUDE COND=(1,80,SS,EQ,C', PR',OR,
                      1,80,SS,EQ,C', CT',OR,
                      1,80,SS,EQ,C', FL',OR,
                      1,80,SS,EQ,C', AZ')
        END
//*


This will give you the list of recrods containing the specific state however if you do not want to have dupilcates, you can use OUTREC and remove the duplicate recrods.
Back to top
View user's profile Send private message
Kumaresan.nk

New User


Joined: 22 Mar 2010
Posts: 31
Location: Chennai

PostPosted: Wed Mar 31, 2010 10:13 am    Post subject:
Reply with quote

Thanks, Vivek. I'll try this.
Back to top
View user's profile Send private message
Kumaresan.nk

New User


Joined: 22 Mar 2010
Posts: 31
Location: Chennai

PostPosted: Wed Mar 31, 2010 10:19 am    Post subject:
Reply with quote

Hey Vivek,

I have a concern. My dataset in which this address data are present is of length 650. This state field might occur at ay point in the dataset. But it occurs only after a comma. My question is since the comma position is variable, will it be possible to extract records in the way that you've mentioned ? And the 80 you've given in the SORT CARD specifies the length, right ?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Mar 31, 2010 10:30 am    Post subject:
Reply with quote

Hi,

your example shows a comma followed by a space followed by the state name, are you saying this is not always the case ?

If this is the case, then just change the 80 to 650.


Gerry
Back to top
View user's profile Send private message
Kumaresan.nk

New User


Joined: 22 Mar 2010
Posts: 31
Location: Chennai

PostPosted: Wed Mar 31, 2010 10:44 am    Post subject:
Reply with quote

Hi,

You are right. The state name occurs after a comma and a space. What i meant was that the comma doesn't always occut at a fixed column.
Back to top
View user's profile Send private message
Kumaresan.nk

New User


Joined: 22 Mar 2010
Posts: 31
Location: Chennai

PostPosted: Wed Mar 31, 2010 12:56 pm    Post subject:
Reply with quote

Hey Vivek / Gerry,

I tried the above code, but there seems to be some hiccup while arriving at the output. Below are my findings -

Output:

0000001002358.....EJIM GULALO 41 HATTERTOWN RD Newtown, MA
0000001011352.....EHELEN M KOCH LAS PALMAS UNIT 478 215 NORTH POWER RD. MESA, PR
0000001041404.....ETALLPINES REHAB & LIVING TALLPINES REHAB & LIVING 34 MARTIN LANE BELFAST, ME
0000001042974.....EAHERN DONALD PO BOX 838 11 MECHANIC ST BUCKSPORT, MA

Input:

000000000001.....SBENJAMIN MUNIZ ROLDOS 1795 CALLE ALCALA SAN JUAN, PR
000001002358.....EJIM GULALO 41 HATTERTOWN RD Newtown, MA
000001010001.....EPHYSICIANS REGIONAL MEDICAL 6101 PINE RIDGE ROAD NAPLES, FL
000001011352.....EHELEN M KOCH LAS PALMAS UNIT 478 215 NORTH POWER RD. MESA, PR
000001033580.....EHEALTH INSURANCE ASSOC LLP 565 WASHINGTON AVE NORTH HAVEN, CT
000001041404.....ETALLPINES REHAB & LIVING TALLPINES REHAB & LIVING 34 MARTIN LANE BELFAST, ME
000001042974.....EAHERN DONALD PO BOX 838 11 MECHANIC ST BUCKSPORT, MA
000001044352.....ELESLIE E HALL PO BOX 58 GRANTHAM, NH
000001044853.....ENARRAGUAGUS BAY HEALTH 179 LISBON ST 2 LEWISTON, ME
000001050541.....ENORTHEAST FINANCIAL GROUP LLC PO BOX 567 EAST LYME, CT


SORT CARD

//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,650,SS,EQ,C'MA')
END
//*


Eventhough i just sepcified 'MA' in my filter criteria, it is pulling up other records too. Am not sure what's going wrong. Can you help me plz.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Mar 31, 2010 1:01 pm    Post subject:
Reply with quote

Hi,

not sure why you have not coded it as mentioned by Vivek.

The output is correct based on your code, all records have the value MA

it should be
Code:
1,650,SS,EQ,C', MA')


Gerry
Back to top
View user's profile Send private message
Kumaresan.nk

New User


Joined: 22 Mar 2010
Posts: 31
Location: Chennai

PostPosted: Wed Mar 31, 2010 3:35 pm    Post subject:
Reply with quote

Hey Gerry,

Thanks for pointing it out. It works fine now. Thanks a lot, guys.
Back to top
View user's profile Send private message
Kumaresan.nk

New User


Joined: 22 Mar 2010
Posts: 31
Location: Chennai

PostPosted: Mon Apr 05, 2010 3:06 pm    Post subject:
Reply with quote

Hey Vivek / Gerry,

I'm again facing pblm with this SORT Card yaar. I gave the below sort card -

SORT FIELDS=COPY
INCLUDE COND=(1,650,SS,EQ,C', MA')
END.

But instead of fetching only MA records, the output file has CA records too !
Can you please help me, guys.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Apr 05, 2010 6:18 pm    Post subject:
Reply with quote

Kumaresan.nk wrote:
But instead of fetching only MA records, the output file has CA records too !
Do "CA-record"s also fall in this range INCLUDE COND=(1,650,SS,EQ,C', MA'), if yes, they might show up.

On the other hand, the input you show in one of your previous replies - they don't have any data in which "CA" is present the way you siad it.. Please show the data for which you say the sort-card is not working. And also show us the expected output.

PS. Keeping in mind that users from different part of the globe log-in to this forum, please avoid using local slang words...icon_smile.gif
Back to top
View user's profile Send private message
Kumaresan.nk

New User


Joined: 22 Mar 2010
Posts: 31
Location: Chennai

PostPosted: Tue Apr 06, 2010 9:41 am    Post subject:
Reply with quote

Hey Anuj,

I fixed it up. The reason why CA records were also showing up was because, the string (', MA') was present in one more field too. So, when i changed the SORT CARD to check for the string like INCLUDE COND=(50,600,SS,EQ,C', MA'), the output came good.

Thanks for checking up, Anuj :-)
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Apr 06, 2010 3:13 pm    Post subject:
Reply with quote

Nice to hear that you got it working icon_smile.gif

Quote:
Hey Anuj,
shhhh...I hope Enrico is not around... icon_wink.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Apr 06, 2010 3:19 pm    Post subject: Reply to: Extract Records From Dataset
Reply with quote

Quote:
shhhh...I hope Enrico is not around...


around an watching icon_biggrin.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Apr 06, 2010 3:22 pm    Post subject:
Reply with quote

he heh - I wish good luck to Kumaresan.nk... icon_lol.gif
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Wed Apr 07, 2010 2:28 am    Post subject: Re: Reply to: Extract Records From Dataset
Reply with quote

Quote:
Quote:
Quote:
Hey Anuj,
shhhh...I hope Enrico is not around...
around an watching icon_biggrin.gif

We're all watching (and quoting) icon_wink.gif

Hi, Anuj, how are you?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Apr 07, 2010 4:03 am    Post subject:
Reply with quote

Marso wrote:
Quote:
Quote:
Quote:
Hey Anuj,
shhhh...I hope Enrico is not around...
around an watching icon_biggrin.gif

We're all watching (and quoting) icon_wink.gif

Hi, Anuj, how are you?
Speak for yourself, marso.....
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Apr 07, 2010 4:05 am    Post subject:
Reply with quote

William Thompson wrote:
Marso wrote:
Quote:
Quote:
Quote:
Hey Anuj,
shhhh...I hope Enrico is not around...
around an watching icon_biggrin.gif

We're all watching (and quoting) icon_wink.gif

Hi, Anuj, how are you?
Speak for yourself, marso.....
Yea, what he said.....
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 1 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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