Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
finding anydata between positions of file using sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
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    Post subject: finding anydata between positions of file using sort
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: 310
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Jul 17, 2018 9:25 pm    Post subject:
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    Post subject:
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: 8410
Location: Dubuque, Iowa, USA

PostPosted: Tue Jul 17, 2018 9:41 pm    Post subject:
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

Active User


Joined: 29 Apr 2008
Posts: 388
Location: Maryland

PostPosted: Tue Jul 17, 2018 10:03 pm    Post subject: Re: finding anydata between positions of file using sort
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: 310
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Jul 17, 2018 10:05 pm    Post subject:
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    Post subject:
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: 310
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Jul 17, 2018 10:23 pm    Post subject:
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    Post subject:
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

Active User


Joined: 29 Apr 2008
Posts: 388
Location: Maryland

PostPosted: Tue Jul 17, 2018 10:32 pm    Post subject:
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    Post subject:
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: 310
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Jul 17, 2018 10:57 pm    Post subject:
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

Moderator


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

PostPosted: Wed Jul 18, 2018 2:14 am    Post subject:
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: 2448
Location: @my desk

PostPosted: Wed Jul 18, 2018 2:31 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Joining 2 records to 1 using Sort cmuncan DFSORT/ICETOOL 1 Sat Dec 08, 2018 8:53 am
No new posts Transferring file to Mainframes Shinoj Vijayakumar IBM Tools 3 Thu Dec 06, 2018 2:35 pm
No new posts Convert VBA file to FB! Vignesh Sid SYNCSORT 5 Mon Dec 03, 2018 1:27 pm
No new posts Another 39 File Status on VB file socker_dad COBOL Programming 5 Tue Nov 27, 2018 6:11 am
No new posts How to handle different file length b... javen777 DFSORT/ICETOOL 15 Mon Nov 26, 2018 12:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us