View previous topic :: View next topic
|
Author |
Message |
Kumaresan.nk
New User
Joined: 22 Mar 2010 Posts: 31 Location: Chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
km_abdullah
New User
Joined: 03 Nov 2008 Posts: 60
|
|
|
|
Hi,
SYNCSORT also supports 'SS' parameter atleast for release
SYNCSORT FOR Z/OS 1.3.2.1R |
|
Back to top |
|
|
SCARCEBOYZ
New User
Joined: 16 May 2005 Posts: 32 Location: Millenium Business Park, Mumbai
|
|
|
|
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 |
|
|
Kumaresan.nk
New User
Joined: 22 Mar 2010 Posts: 31 Location: Chennai
|
|
|
|
Thanks, Vivek. I'll try this. |
|
Back to top |
|
|
Kumaresan.nk
New User
Joined: 22 Mar 2010 Posts: 31 Location: Chennai
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
Kumaresan.nk
New User
Joined: 22 Mar 2010 Posts: 31 Location: Chennai
|
|
|
|
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 |
|
|
Kumaresan.nk
New User
Joined: 22 Mar 2010 Posts: 31 Location: Chennai
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
Kumaresan.nk
New User
Joined: 22 Mar 2010 Posts: 31 Location: Chennai
|
|
|
|
Hey Gerry,
Thanks for pointing it out. It works fine now. Thanks a lot, guys. |
|
Back to top |
|
|
Kumaresan.nk
New User
Joined: 22 Mar 2010 Posts: 31 Location: Chennai
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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... |
|
Back to top |
|
|
Kumaresan.nk
New User
Joined: 22 Mar 2010 Posts: 31 Location: Chennai
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Nice to hear that you got it working
shhhh...I hope Enrico is not around... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
shhhh...I hope Enrico is not around... |
around an watching |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
he heh - I wish good luck to Kumaresan.nk... |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Quote: |
Quote: |
shhhh...I hope Enrico is not around... |
around an watching |
We're all watching (and quoting)
Hi, Anuj, how are you? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Marso wrote: |
Quote: |
Quote: |
shhhh...I hope Enrico is not around... |
around an watching |
We're all watching (and quoting)
Hi, Anuj, how are you? |
Speak for yourself, marso..... |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
William Thompson wrote: |
Marso wrote: |
Quote: |
Quote: |
shhhh...I hope Enrico is not around... |
around an watching |
We're all watching (and quoting)
Hi, Anuj, how are you? |
Speak for yourself, marso..... |
Yea, what he said..... |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Marso wrote: |
Quote: |
Quote: |
shhhh...I hope Enrico is not around... |
around an watching |
We're all watching (and quoting)
Hi, Anuj, how are you? |
Having you guys around, makes me feel safe ...
'am doing good - how about you? |
|
Back to top |
|
|
|