Page 1 of 1

Sorting to filter datasets exceeding 50 columns

PostPosted: Thu May 03, 2012 7:10 pm
by utpalpal07
IF I NEED TO SORT A FILE CONTAINING DATA SETS:

 Command ===>                                                  Scroll ===> CSR 
 =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
****** ***************************** Top of Data ***************************************
 000006 TEST.DATA.DECIMAL.TXT                                         
 000007 TEST.DATA.DECIMAL.TXT.FIND.LIKE.SOME                   
 000008 TEST.DATA.DECIMAL.TXT.FIND.SOME.TESTING.SHOULD.DONE.DECIMAL1.DECIMAL2
 000009 TEST.DATA.DECIMAL.TXT.FIND.DECIMAL6.SOME.TESTING.SHOULD.DONE.DECIMAL1.DECIMAL2
 000010 TEST.DATA.DECIMAL.TXT.TODAY                                       
 ****** **************************** Bottom of Data ************************************


 Command ===>                                                  Scroll ===> CSR   
 =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
****** ***************************** Top of Data ***************************************
 000006 TEST.DATA.DECIMAL.TXT                                                           
 000007 TEST.DATA.DECIMAL.TXT.FIND.LIKE.SOME                   
 000008 TEST.DATA.DECIMAL.TXT.TODAY                                       
 ****** **************************** Bottom of Data ************************************



ITS NOT FIXED THAT THERE WILL BE 4 OR 5 DATASETS ONLY. THE DATASETS EXCEEDING LENGTH 50 COLS SHOULD GETS SKIPPED OR SHOULDNT GET COPIED IN ANOTHER FILE.

WHICH SORT CONDITIONS I NEED TO DO?
I TRIED WITH OMIT AND SEVERAL MANY.

Re: SORTING

PostPosted: Thu May 03, 2012 7:19 pm
by Akatsukami
  1. DON'T SHOUT AT US, MUSHI; turn off your caps lock.
  2. What is your sort product? (Hint: it's not JCL.)
  3. Is the input data set (not the text, the data set itself) fixed or variable format?

Re: SORTING

PostPosted: Thu May 03, 2012 7:33 pm
by BillyBoyo
Assuming that they all start at position one in a fixed-length-record dataset, this should get you started. If col 51 is blank, then you have something shorter than or equal to 50 characters, given that "datasets" cannot contain embedded spaces.

You might want to check on the maximum lengths of dataset names and the maximum number of fullstops/periods.

  SORT FIELDS=COPY
  OMIT COND=(51,1,CH,NE,C' ')


What are you actually trying to do?

Re: Sorting to filter datasets exceeding 50 columns

PostPosted: Fri May 04, 2012 12:32 am
by dick scherrer
Hello,

IF I NEED TO SORT A FILE CONTAINING DATA SETS:
I rather think Not. . .

Your posted "data" might be DataSet Names . . .

If they are, what should be done with them?

Do you want to copy each of the files named in the "input"? Keep in mind that the mainframe does not support dataset names that are longer than 44, so how does 50 relate to the question?
If yes, how should the new dataset name be determined - it will not be the same as the original.

Re: Sorting to filter datasets exceeding 50 columns

PostPosted: Fri May 04, 2012 10:53 am
by utpalpal07
Hello guys,

Actually these datasets are coming from unix server to mainframe.
so i need the datasets which are less than 50 bytes.
n i want to sort the valid datasets in another file using JCL.

Regards
Utpal

Re: Sorting to filter datasets exceeding 50 columns

PostPosted: Fri May 04, 2012 12:17 pm
by utpalpal07
Hello Billy,

Thanks for your suggestion. it worked for me.
But can you also tell me how can i sort only the dataset greater than 50 bytes into a file and filtering the other datasets less than 50 bytes.

For eg:
 =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7-----+----8----+----9----+----0----+----1----+----2----+----3--
 000001 Testdatei-mit-Sonderzeichen.txt.dfumtesting.s.da.find.x.e.sw.testingdfum1234567.now.Testdatei-mit-Sonderzeichen.txt.dfumtesting.s.da


Please reply.
Regards
Utpal

Re: Sorting to filter datasets exceeding 50 columns

PostPosted: Fri May 04, 2012 12:41 pm
by BillyBoyo
Something like this then:

  SORT FIELDS=COPY
  OUTFIL FILES=SHORT,COND=(51,1,CH,NE,C' ')
  OUTFIL FILES=LONG,SAVE


You keep mentioning that you want to "sort". If you do want to change the order, are you OK with that bit?

Re: Sorting to filter datasets exceeding 50 columns

PostPosted: Fri May 04, 2012 12:57 pm
by BillyBoyo
Whoops. I deleted the wrong part.

  SORT FIELDS=COPY
  OUTFIL FILES=SHORT,INCLUDE=(51,1,CH,EQ,C' ')
  OUTFIL FILES=LONG,SAVE


Notice I've changed to INCLUDE and reversed the condition to EQ.

The "SAVE" is a useful way to make sure nothing "falls down the cracks" when you have multiple OUTFILs with INCLUDE/OMIT.

Re: Sorting to filter datasets exceeding 50 columns

PostPosted: Fri May 04, 2012 7:20 pm
by utpalpal07
Thanks Billy, Thanks Guys.