IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

finding anydata between positions of file using sort


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Jul 17, 2018 9:14 pm
Reply with quote

HI Friends,

I have a file length of 1200 and I want to find if there is any data between 210 to 1200 . if not spaces i need to write to another file.

Code:

SORT FIELDS=COPY                 
INCLUDE COND=((210,990,CH,NE,C' ')


CAN YOU please suggest if my approach is correct
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Jul 17, 2018 9:25 pm
Reply with quote

What happened when you tried it.
Check this post.
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Jul 17, 2018 9:36 pm
Reply with quote

mistah kurtz wrote:
What happened when you tried it.
Check this post.


I think there is a limit in sort on the position that validates for any condition. its working when i give postion 10 or 20 but when I give position 900 throwing error

SYSIN :
SORT FIELDS=COPY
INCLUDE COND=(212,788,CH,NE,C' ')
*
INSTALLATION OPTIONS IN MFXPRMIT WILL BE USED
INCLUDE/OMIT INVALID LENGTH
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jul 17, 2018 9:41 pm
Reply with quote

The manual indicates a limit of 256 bytes for CH comparisons.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2012
Location: USA

PostPosted: Tue Jul 17, 2018 10:03 pm
Reply with quote

1) Your logic is wrong
2) Your syntax was wrong, too
Code:

SORT FIELDS=COPY                 
INCLUDE COND=(210,990,SS,NE,C' ')
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Jul 17, 2018 10:05 pm
Reply with quote

You can try SS option
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Jul 17, 2018 10:07 pm
Reply with quote

mistah kurtz wrote:
You can try SS option


I coded as below but still not working.

Code:

SORT FIELDS=COPY                                             
OMIT COND=((212,200,CH,NE,C' '),AND,(412,200,CH,NE,C' '),AND,
              (612,200,CH,NE,C' '),AND,(812,200,CH,NE,C' '))     
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Jul 17, 2018 10:23 pm
Reply with quote

Quote:
I coded as below but still not working.

It's not very useful. Could you please try with what sergeyken suggested and post the full sysout.
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Jul 17, 2018 10:30 pm
Reply with quote

mistah kurtz wrote:
Quote:
I coded as below but still not working.

It's not very useful. Could you please try with what sergeyken suggested and post the full sysout.


its not working though

Code:
SORT FIELDS=COPY                 
INCLUDE COND=(212,200,SS,NE,C' ')


even with length as 900 its not working...file has many records but throwing empty file.

Code:

********************************* TOP OF DATA **********************************
 SYNCSORT FOR Z/OS  2.1.4.0R    U.S. PATENTS: 4210961, 5117495   (C) 2014 SYNCSO
            STATE OF WISCONSIN - DET SERVICES, ESD HELPDESK:    608-264-9383  80
 SYNCSORT LICENSED FOR CPU SERIAL NUMBER 5E6E7, MODEL 3906 704             LICEN
 SYSIN :                                                                       
    SORT FIELDS=COPY                                                           
    INCLUDE COND=(212,890,SS,NE,C' ')                                           
 WER813I  INSTALLATION OPTIONS IN MFXPRMIT WILL BE USED                         
 WER276B  SYSDIAG= 7953145, 12350668, 12350668, 25550320                       
 WER164B  6,904K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,             
 WER164B     0 BYTES RESERVE REQUESTED, 2,376K BYTES USED                       
 WER146B  12K BYTES OF EMERGENCY SPACE ALLOCATED                               
 WER108I  SORTIN   : RECFM=FB   ; LRECL=  1200; BLKSIZE= 27600                 
 WER073I  SORTIN   : DSNAME=DWDCARES.RT41.D07111                               
 WER110I  SORTOUT  : RECFM=FB   ; LRECL=  1200; BLKSIZE= 27600                 
 WER074I  SORTOUT  : DSNAME=DWDCARES.CAREF.DESIGN                               
 WER410B  5,876K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16-MEGABYTE LINE,
 WER410B     0 BYTES RESERVE REQUESTED, 2,228K BYTES USED                       
 WER055I  INSERT          0, DELETE      23331                                 
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                 
 WER416B  SORTIN   : EXCP'S=57,UNIT=3390,DEV=6458,CHP=28292A2BA8A9AAAB,VOL=SLR04
 WER416B  SORTOUT  : EXCP'S=0,UNIT=3390,DEV=60BF,CHP=28292A2BA8A9AAAB,VOL=SHR027
 WER416B  TOTAL OF 57 EXCP'S ISSUED FOR COPYING                                 
 WER054I  RCD IN      23331, OUT          0                                     
 WER169I  RELEASE 2.1 BATCH 0539 TPF LEVEL 4.0                                 
 WER052I  END SYNCSORT - PWCCRDES,STEP020,,DIAG=AE00,710A,8200,004E,E6FE,48A3,06
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2012
Location: USA

PostPosted: Tue Jul 17, 2018 10:32 pm
Reply with quote

ram_vizag wrote:
mistah kurtz wrote:
You can try SS option


I coded as below but still not working.

Code:

SORT FIELDS=COPY                                             
OMIT COND=((212,200,CH,NE,C' '),AND,(412,200,CH,NE,C' '),AND,
              (612,200,CH,NE,C' '),AND,(812,200,CH,NE,C' '))     

1) Please, learn some basics of logical operations. Your example is senseless
2) You are given ready-to-use solution above. Stop re-inventing the wheel. Force self-education.
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Jul 17, 2018 10:38 pm
Reply with quote

sergeyken wrote:
ram_vizag wrote:
mistah kurtz wrote:
You can try SS option


I coded as below but still not working.

Code:

SORT FIELDS=COPY                                             
OMIT COND=((212,200,CH,NE,C' '),AND,(412,200,CH,NE,C' '),AND,
              (612,200,CH,NE,C' '),AND,(812,200,CH,NE,C' '))     

1) Please, learn some basics of logical operations. Your example is senseless
2) You are given ready-to-use solution above. Stop re-inventing the wheel. Force self-education.



I used SS but its not working.
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Jul 17, 2018 10:57 pm
Reply with quote

You have Syncsort not DFSORT. Please check the Syncsort manual what it says about comparisons.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Wed Jul 18, 2018 2:14 am
Reply with quote

Are you sure the contents of the file has spaces and not low values?

Can you also check for X'00' ??

Also moved the topic to right forum
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Jul 18, 2018 2:31 am
Reply with quote

Looks like the OP is trying to exclude all-blanks in positions 210 thru 1200 into one output, ie INCLUDE records with ANY non blank character in ANY of these positions.

The SS 'solution' suggested above does not seem to apply to the OP's problem. It INCLUDEs records with ALL the positions 210 thru 1200 filled with non-blank characters. (the OP might not have such a record and ended up with an empty output).

Changing the NEs to EQs in OP's original control card like this would have been one of the options.
Code:
 SORT FIELDS=COPY
 OMIT COND=(212,256,CH,EQ,C' ',AND,
            468,256,CH,EQ,C' ',AND,
            724,256,CH,EQ,C' ',AND,
            980,.........)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top