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
 

 

Removing lines from the input file
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Fri Aug 26, 2011 12:57 am    Post subject: Removing lines from the input file
Reply with quote

Hi,

I want to remove few lines from input file depending on some criterion.
File file looks like

Code:
1IBM File Manager for z/OS                                     
0                                                             
-                                                             
0FMNBA001 IBM File Manager for z/OS Version 11 Release 1       
0FMNBA010 Not APF authorized                                   
0FMNBA010 Service Levels of installed components               
0FMNBA010              Base       IMS        DB2        CICS   
0FMNBA010 English      UK66921    UK66925    UK66923    UK66274
     New data set fields:   NAME      SURNAME 
     ID NREC-# OREC-#       <---+---> <---+--->
     I  000001              abcd     klgjk     
     I  000003              hhjh      jlkjlj   
     Old data set fields:   NAME      SURNAME 
     ID NREC-# OREC-#       <---+---> <---+--->
     D         000002       aaaaa     bbbb   
     C  000004              fffffff       yyyy   
     O         000003       sgg         lllll     
                                      |||||   


I want to remove all the lines above 'New data set fields:'. I tried to do it using OMIT COND=(1,1,CH,EQ,C'0',or....) but it is not removed. Please suggest.[/quote]
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Aug 26, 2011 1:00 am    Post subject: Reply to: Removeing lines from the input file
Reply with quote

Presuming your dataset is FB, how about omitting all of position 1 that's NOT blank?
Back to top
View user's profile Send private message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Fri Aug 26, 2011 1:18 am    Post subject:
Reply with quote

This file has the same layout of the input file. The input file is a FB. But while crating this file it is becoming VBA. So do I need to change itto FB first? Or there is some other way to do it?
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Aug 26, 2011 1:51 am    Post subject: Reply to: Removeing lines from the input file
Reply with quote

Well, if the dataset is VBA, then you should know that the first four bytes are reserved for the Record Descriptor Word (RDW) and that they need to be taken into account. The fifth byte is the ASA Carriage-Control, and byte six and on is the rest of the data.

So, an easy SORT OMIT statement might be coded like:

Code:

  OPTION COPY
  OMIT COND=(5,1,CH,NE,C' ')
Back to top
View user's profile Send private message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Fri Aug 26, 2011 2:58 am    Post subject:
Reply with quote

Thanks Kevin. It is working now. But I have another condition. I have remove
Code:
 $$FILEM PACK=UNPACK,


Code:
 PRINTOUT=SYSPRINT


this kind of line as well. For this I used
Code:
OPTION COPY
  OMIT COND=((5,1,CH,NE,C' ') ,OR,
                      (6,5,CH,EQ,C'PRINT'),OR,
                      (6,2,CH,EQ,C'$$'))


But this is giving me ABEND and the message is like
Code:
SYNCSORT FOR Z/OS  1.4.0.0R    U.S. PATENTS: 4210961, 5117495   (C) 2010 S
                                   JOHN HANCOCK FINANCIAL SERVICES   z/OS
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 2EF15, MODEL 2098 P02             
SYSIN :                                                                   
  SORT FIELDS=COPY                                                      00
   OMIT COND=(6,2,CH,EQ,C'$$')                                          00
WER276B  SYSDIAG= 14506, 448289, 448289, 980625                           
WER164B  9,900K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,       
WER164B     24K BYTES RESERVE REQUESTED, 2,324K BYTES USED               
WER146B  20K BYTES OF EMERGENCY SPACE ALLOCATED                           
WER108I  SORTIN   : RECFM=VBA  ; LRECL= 32756; BLKSIZE= 32760             
WER073I  SORTIN   : DSNAME=ORD.PYNPRIY.TEST.SYSPRINT                     
WER110I  SORTOUT  : RECFM=VBA  ; LRECL= 32756; BLKSIZE= 32760             
WER074I  SORTOUT  : DSNAME=ORD.PYNPRIY.TEST.CHANGED.HILITD               
WER410B  7,848K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE, 
WER410B     0 BYTES RESERVE REQUESTED, 2,184K BYTES USED                 
WER055I  INSERT          0, DELETE          0                             
WER250A  INCLUDE/OMIT FIELD BEYOND RECORD                                 


Could you please tell me what is the problem. I am sorry for the long message but I really have no clue how to solve this error. Please suggest something to solve this.[/quote]
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Fri Aug 26, 2011 3:26 am    Post subject: Reply to: Removeing lines from the input file
Reply with quote

You are not getting an Abend. Your step is not completing successfully, but that is a different thing.

This is the problem:

Quote:
WER250A INCLUDE/OMIT FIELD BEYOND RECORD


It would seem that all the lines in your print output are at least one byte long (actually 5, including the RDW). However, there are certainly some which are less than 11 bytes long. On encountering the first of those, the SORT does not know how to proceed.
Back to top
View user's profile Send private message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Fri Aug 26, 2011 3:30 am    Post subject:
Reply with quote

Hi Bill,

Can you provide me any solution . icon_sad.gif
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Fri Aug 26, 2011 3:45 am    Post subject: Reply to: Removeing lines from the input file
Reply with quote

As I've just written for another post, I dont' have a SyncSORT manual.

You need to "protect" the test from a short record. I'm sure there is a "proper" way to do this (I've seen reference to it in this forum, you'd have to search, try looking for "short record" or the error message you got, try google if the forum search doesn't work for you). Or hit your manual.

If you are desperate tonight, try changing it to INCLUDE (remembering to swap your condition around) and before the test that must be longer than one byte, test the record-lenght for less than 8/11 (whatever, check) so that all the short ones are included before you do the test for those you want to exclude).

If you can't get to the proper solution yourself, someone will come up with it tommorow I'm sure, if you are able to wait that long.
Back to top
View user's profile Send private message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Fri Aug 26, 2011 3:55 am    Post subject:
Reply with quote

Thanks a lot for your suggestion Bill. I have used PARM='VLTESTI=1' and it is working now icon_smile.gif
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Fri Aug 26, 2011 4:00 am    Post subject:
Reply with quote

Glad to hear it. I'll remember that now.

Perhaps, and maybe not just for me, you can explain the options available on VLTESTI?
Back to top
View user's profile Send private message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Fri Aug 26, 2011 4:06 am    Post subject:
Reply with quote

It's in the manual...... However I am just copying this for reference


The delivered default of 0 instructs SyncSort to terminate if a record does not completely contain all INCLUDE or OMIT fields. A WER250A critical error message is generated to indicate this condition.

When VLTESTI=1 is specified, a record that does not completely contain all INCLUDE/OMIT fields is treated as having failed the comparison. SyncSort will omit the record if INCLUDE is being used or include the record if OMIT has been specified.

When VLTESTI=2 is specified, SyncSort will treat comparisons to fields not completely contained within the record as false and decide a record?s status for inclusion or omission from fields that are available. If all fields are not present, the record will be processed as having failed the comparison. SyncSort will omit the record if INCLUDE is being used or include the record if OMIT has been specified.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Fri Aug 26, 2011 4:10 am    Post subject: Reply to: Removeing lines from the input file
Reply with quote

Thanks Priyanka.
Back to top
View user's profile Send private message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Fri Aug 26, 2011 9:13 pm    Post subject:
Reply with quote

I have one more requrement. My file looks like as below

Code:
                                                                       
                                                                       
                                                                       
                                                                       
 New data set fields:   NAME      SURNAME                               
 ID NREC-# OREC-#       <---+---> <---+--->                             
 I  000001              mmmmmmm   nnnn                                 
 I  000003              rrrrr     ggggg                                 
 Old data set fields:   NAME      SURNAME                               
 ID NREC-# OREC-#       <---+---> <---+--->                             
 D         000002       rrrrrr     ggggg                                 
 C  000004              sssssss   hhhhh                                 
 O         000003       sssssss   ppp                                   
                                  |||||                                 
                                                                       
                                                                       


I need to remove all the blank lines i.e. all the lines which have nothing at all(there will be lines which will have '||' in the lines and their position cannot be pre determind)from my output file. I cannot put OMIT COND=((5,1,CH,NE,C' ') as this will remove all the lines whose first position is blank including the last line which I dont want.

Please suggest something.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Fri Aug 26, 2011 9:18 pm    Post subject: Reply to: Removing lines from the input file
Reply with quote

I guess you could "scan" for the "||" and omit/not include.

Then choose a position which is always populated (first non-blank looks OK from your sample) and omit/not include blank in that position. Should work with your VLTESTI setting.
Back to top
View user's profile Send private message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Fri Aug 26, 2011 10:36 pm    Post subject:
Reply with quote

Hi Bill,

Are you asking me to scan through JCL for ||? I am not sure how to do that. I will have to do some googling and let you know the result.

By this time if you or anyone can provide me any other solution that will be great icon_smile.gif
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Fri Aug 26, 2011 10:42 pm    Post subject: Reply to: Removing lines from the input file
Reply with quote

With the SORT. There is something to scan or search for a character. Sorry to be unclear, but I'm no expert with SORT. No manual.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Sat Aug 27, 2011 10:49 am    Post subject:
Reply with quote

Priyanka Pyne,

You could use 'SS' to search for a string and INCLUDE/OMIT the record based on its presence of absence irrespective of its position in the record. I am away from work and can't run a test now.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sat Aug 27, 2011 2:00 pm    Post subject: Reply to: Removing lines from the input file
Reply with quote

Quote:
I will have to do some googling and let you know the result.


search the DFSORT forum, lots of examples there
and also regarding the docs some of the DFSORT principles apply also to SYNCSORT

start from here choose a zOS version fro 1.10 UP and wander thru the DFSORT bookshelves
http://www.ibm.com/systems/z/os/zos/bkserv/index.html

also looking at links provide by Frank for DFSORT advanced utilization might give You good hints on how to proceed
Back to top
View user's profile Send private message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Sun Aug 28, 2011 1:39 am    Post subject:
Reply with quote

I have tried to use SS. But the thing is mine is a VB file and I want to searcg starting from position 1 throuh the entire line.I have also tried

Code:
 SORT FIELDS=COPY
 OMIT COND=(85,maxlrecl-84,SS,EQ,C' ')


It is giving me error at M.
Code:
SYNCSORT FOR Z/OS  1.4.0.0R    U.S. PATENTS: 4210961, 5117495   (C) 2010 SYNCSO
                                   JOHN HANCOCK FINANCIAL SERVICES   z/OS   1.1
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 2EF15, MODEL 2098 P02             LICEN
SYSIN :                                                                       
    OPTION    VLSHRT                                                           
    SORT FIELDS=COPY                                                           
     OMIT COND=(85,maxlrecl-84,SS,EQ,C' ')                                     
                   *                                                           
WER251A  INCLUDE/OMIT INVALID LENGTH                                           
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                 
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Sun Aug 28, 2011 5:35 am    Post subject: Reply to: Removing lines from the input file
Reply with quote

Remember I suggested the search for the vertical bars?

Once they are out of the way, look at your report and find the first column which contains data.

For the spaces, try to exclude all records which are shorter than the column with the first piece of data in.
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, 3  Next
Page 1 of 3

 

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 Performing arithmetic on input field zh_lad DFSORT/ICETOOL 22 Tue Dec 06, 2016 8:04 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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