Sorting to filter datasets exceeding 50 columns



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Sorting to filter datasets exceeding 50 columns

Postby utpalpal07 » Thu May 03, 2012 7:10 pm

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.
utpalpal07
 
Posts: 43
Joined: Wed Feb 08, 2012 12:02 pm
Has thanked: 1 time
Been thanked: 0 time

Re: SORTING

Postby Akatsukami » Thu May 03, 2012 7:19 pm

  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?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: SORTING

Postby BillyBoyo » Thu May 03, 2012 7:33 pm

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?

These users thanked the author BillyBoyo for the post:
utpalpal07 (Fri May 04, 2012 3:47 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Sorting to filter datasets exceeding 50 columns

Postby dick scherrer » Fri May 04, 2012 12:32 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Sorting to filter datasets exceeding 50 columns

Postby utpalpal07 » Fri May 04, 2012 10:53 am

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
utpalpal07
 
Posts: 43
Joined: Wed Feb 08, 2012 12:02 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Sorting to filter datasets exceeding 50 columns

Postby utpalpal07 » Fri May 04, 2012 12:17 pm

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
utpalpal07
 
Posts: 43
Joined: Wed Feb 08, 2012 12:02 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Sorting to filter datasets exceeding 50 columns

Postby BillyBoyo » Fri May 04, 2012 12:41 pm

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?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Sorting to filter datasets exceeding 50 columns

Postby BillyBoyo » Fri May 04, 2012 12:57 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Sorting to filter datasets exceeding 50 columns

Postby utpalpal07 » Fri May 04, 2012 7:20 pm

Thanks Billy, Thanks Guys.
utpalpal07
 
Posts: 43
Joined: Wed Feb 08, 2012 12:02 pm
Has thanked: 1 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post