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
 

 

Syncsort - ALPHABETIC check in SORT
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
nareshdacha

New User


Joined: 12 Jan 2010
Posts: 66
Location: US

PostPosted: Thu Jul 21, 2011 3:34 am    Post subject: Syncsort - ALPHABETIC check in SORT
Reply with quote

I have the input file as follows:
Input file length is 80 and RECFM is FB. This file contains only one field which is of X(18). Now i need to extract only ALPHABETIC values to the output file using SORT CARD.
In COBOL, i can do that using ' IS ALPHABETIC' am not supposed to use COBOL program for this.

In forum, i found how to check NUMERIC but didn't find for ALPHABETIC.

Input file:
Code:

ABCD1234
PQRS
PQRS8989
BNBUI
EWEWEW
9090909


Output should be:
Code:

PQRS
BNBUI
EWEWEW

Can anyone suggest me on this ????
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Jul 21, 2011 4:22 am    Post subject:
Reply with quote

If you mean that you want to only include a record if EVERY character in that record is uppercase A-Z or blank, you can use a DFSORT job like the following:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
ALPHA,' ABCDEFGHIJKLMNOPQRSTUVWXYZ'
//SORTIN DD *
ABCD1234
PQRS
PQRS8989
BNBUI
EWEWEW
9090909
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  OMIT FORMAT=SS,                       
       COND=(1,1,NE,ALPHA,OR,           
             2,1,NE,ALPHA,OR,           
             3,1,NE,ALPHA,OR,           
             4,1,NE,ALPHA,OR,           
             5,1,NE,ALPHA,OR,           
             6,1,NE,ALPHA,OR,           
             7,1,NE,ALPHA,OR,           
             8,1,NE,ALPHA,OR,           
             9,1,NE,ALPHA,OR,           
            10,1,NE,ALPHA,OR,           
            11,1,NE,ALPHA,OR,           
            12,1,NE,ALPHA,OR,           
            13,1,NE,ALPHA,OR,           
            14,1,NE,ALPHA,OR,           
            15,1,NE,ALPHA,OR,           
            16,1,NE,ALPHA,OR,           
            17,1,NE,ALPHA,OR,           
            18,1,NE,ALPHA)             
/*
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jul 21, 2011 4:53 am    Post subject:
Reply with quote

Hi,

do spaces qualify as ALPHABETIC ?

Does this qualify for output
Code:
 PQRS



Gerry
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Jul 21, 2011 5:01 am    Post subject: Reply to: ALPHABETIC check in SORT
Reply with quote

From the sample data, yes, as far as it goes - first input line is blank, as is first output. Up to TS, I suppose, to come back if he doesn't want leading spaces followed by letters.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jul 21, 2011 5:10 am    Post subject:
Reply with quote

Hi Bill,

I missed the first input line icon_redface.gif


Gerry
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Jul 21, 2011 5:12 am    Post subject:
Reply with quote

I assumed leading, trailing and embedded spaces would be considered alphabetic. If that's not the case, then the OP will have to define what he wants more precisely.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Jul 21, 2011 5:21 am    Post subject: Reply to: ALPHABETIC check in SORT
Reply with quote

Hi Gerry,

Very easily done, the blank line can become invisible when pondering the leading spaces. When I set out test data, I put "this line intentionally left blank". Personally I'd suspect that the TS thinks leading blanks are not possibile - however, data had to come from somewhere, usually leads back to data-entry at some point and he should want to know whether to include or not, which is where your question helps anyway.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jul 21, 2011 6:41 am    Post subject:
Reply with quote

Hi Bill,

from OP
Quote:
In COBOL, i can do that using ' IS ALPHABETIC' am not supposed to use COBOL program for this.


I'm no Cobol programmer, so I googled and found this
Quote:
In OS/VS COBOL, only uppercase letters and the space character were considered to be ALPHABETIC.
In Enterprise COBOL, uppercase letters, lowercase letters, and the space character are considered to be ALPHABETIC.

If your OS/VS COBOL program uses the ALPHABETIC class test, and the data tested consists of mixed uppercase and lowercase letters, there can be differences in execution results. In such cases, you can ensure identical results by substituting the Enterprise COBOL ALPHABETIC-UPPER class test for the OS/VS COBOL ALPHABETIC test.



So it seems spaces are acceptable.

Gerry
Back to top
View user's profile Send private message
nareshdacha

New User


Joined: 12 Jan 2010
Posts: 66
Location: US

PostPosted: Thu Jul 21, 2011 8:48 am    Post subject: Reply to: ALPHABETIC check in SORT
Reply with quote

Thank you all for your suggestions...
When i try to execute the code no records got selected..
Sorry for the confusion...SPACES are not required for the output.

My job log details:

Code:

WER164B  8,884K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B     0 BYTES RESERVE REQUESTED, 1,412K BYTES USED
WER146B  12K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I  SORTIN   : RECFM=FB   ; LRECL=    80; BLKSIZE=    80
WER110I  SORTOUT  : RECFM=FB   ; LRECL=    80; BLKSIZE= 27920
WER410B  7,856K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LIN
WER410B     0 BYTES RESERVE REQUESTED, 1,284K BYTES USED
WER055I  INSERT          0, DELETE          5
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER416B  BSAM WAS USED FOR SORTIN
WER416B  SORTOUT  : EXCP'S=0,UNIT=3390,DEV=C78A,CHP=(B0B1B2B3B4B5B6,1)
WER054I  RCD IN          5, OUT          0
WER169I  RELEASE 1.3 BATCH 0492 TPF LEVEL 2.1
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jul 21, 2011 8:57 am    Post subject:
Reply with quote

Hi,

please show the entire job you have run.

Also the number of records read does not match your original input of 7 records.


Gerry
Back to top
View user's profile Send private message
nareshdacha

New User


Joined: 12 Jan 2010
Posts: 66
Location: US

PostPosted: Thu Jul 21, 2011 9:02 am    Post subject: Reply to: ALPHABETIC check in SORT
Reply with quote

Here is my job...

Code:

//STEP1    EXEC  PGM=SORT
//SYMNAMES DD *
ALPHA,'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
//SORTIN   DD  *
ABCD1234
PQRS
PQRS8989
EWEWEW
9090909
//SORTOUT  DD  DSN=XXX.YYYY,DISP=(NEW,CATLG),
//             DCB=(RECFM=FB,LRECL=80),SPACE=(CYL,(5,5))
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SYSIN    DD  *
OPTION COPY
OMIT FORMAT=SS,
COND=(1,1,NE,ALPHA,OR,
      2,1,NE,ALPHA,OR,
      3,1,NE,ALPHA,OR,
      4,1,NE,ALPHA,OR,
      5,1,NE,ALPHA,OR,
      6,1,NE,ALPHA,OR,
      7,1,NE,ALPHA,OR,
      8,1,NE,ALPHA,OR,
      9,1,NE,ALPHA,OR,
     10,1,NE,ALPHA,OR,
     11,1,NE,ALPHA,OR,
     12,1,NE,ALPHA,OR,
     13,1,NE,ALPHA,OR,
     14,1,NE,ALPHA,OR,
     15,1,NE,ALPHA,OR,
     16,1,NE,ALPHA,OR,
     17,1,NE,ALPHA,OR,
     18,1,NE,ALPHA)
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jul 21, 2011 9:11 am    Post subject:
Reply with quote

Hi,

you have dropped the space before ABC
Code:
ALPHA,' ABCDEFGHIJKLMNOPQRSTUVWXYZ'


Gerry
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jul 21, 2011 9:45 am    Post subject:
Reply with quote

Hi Gerry,

Quote:
you have dropped the space before ABC


Quote:
Sorry for the confusion...SPACES are not required for the output.


I may be missing somethng, but it appears that spaces are NOT to be selected. . .

All of the compares go thru position 18 and none of the data is that long. . .?

I don't have Syncsort documentation on this system, so i can't read up tonight. . .
Back to top
View user's profile Send private message
nareshdacha

New User


Joined: 12 Jan 2010
Posts: 66
Location: US

PostPosted: Thu Jul 21, 2011 9:53 am    Post subject: Reply to: ALPHABETIC check in SORT
Reply with quote

Thanks for the correction...
Thank you all for your time and suggestion..
Back to top
View user's profile Send private message
nareshdacha

New User


Joined: 12 Jan 2010
Posts: 66
Location: US

PostPosted: Thu Jul 21, 2011 9:55 am    Post subject: Reply to: Syncsort - ALPHABETIC check in SORT
Reply with quote

Am filtering SPACES records in other step....
Can we do that in that step itself ?..
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jul 21, 2011 10:56 am    Post subject:
Reply with quote

Hi Dick,

Quote:
I may be missing somethng, but it appears that spaces are NOT to be selected. . .



All records have a space between 1-18, if the field that has a space in it is not to be selected then none of the records pass the test.

I really think the op means a combination of spaces and A-Z is ok.

A field with all spaces is to be dropped.

Naresh, is this what you mean ?

Gerry
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jul 21, 2011 10:56 am    Post subject:
Reply with quote

Hello,

Possibly - once we understand exactly what you want in total.

If you post the original input data including all cases and then show how you want each record handled (completely explain the rules - for example should a bunch of trailing spaces be ignored or should these cause records to be omitted?), someone will probably have a suggestion.

Please use the "Code" tag to preserve alignment and improve readability.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Jul 21, 2011 10:59 am    Post subject:
Reply with quote

The TS is using SYNCSORT not DFSORT.
Frank Yaeger's sample is DFSORT.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jul 21, 2011 11:02 am    Post subject:
Reply with quote

Hi Peter,

it works with SYNCSORT as well.


Gerry
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Jul 21, 2011 11:25 am    Post subject:
Reply with quote

Hi Gerry,

i thought the TS had a problem (getting no output), caused by using SS instead of DS.
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 syncsort: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 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
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am


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