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
 

 

Need single sort card to sort and pick the topmost rec
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Wed Nov 17, 2010 8:23 pm    Post subject: Need single sort card to sort and pick the topmost rec
Reply with quote

Hi,

I have the following req for which i need a help.

Please see the attachment for the details and advice.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Wed Nov 17, 2010 8:27 pm    Post subject: Reply to: Need single sort card to sort and pick the topmost
Reply with quote

do not post attachments, ( anyway there were no attachments )
not everybody can see them

paste as text and use the code tags like this ...
Code:
text formatted with the code tags

and before hitting the submit button use the preview button to check that everything is understandable
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Nov 17, 2010 8:28 pm    Post subject:
Reply with quote

Errrrrr, had you provided the attachment I for one would not be able to open it, so post the input data and expected results using the code tags.

Also explain exactly what it is that you want to achieve.

Please run the code below to establish the sort product and release level installed in your site by posting the JES SYSOUT element.
Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY
Also provide details, LRECL & RECFM of the input and output files, the position, length and format of any key fields.

Also show what you have tried so far and the problems encountered.
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Thu Nov 18, 2010 11:53 am    Post subject:
Reply with quote

I am sorry but donno why the screenshots are not getting pasted here..any way below are info in text fmt...please let me know if any other info is needed.

I am using syncsort.
Below is the LISTCAT history for a GDG file converted to a FB LRECL=120 file. I want to pick the latest GDG name which appears at the bottom.

Code:
Command ===>                                                  Scroll ===
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+
000016       ATTRIBUTES                                                 
000017 0NONVSAM ------- TTA.TAI23.VRS.CESSDATA.G0024V00                 
000018       IN-CAT --- TICFCATC                                         
000019       HISTORY                                                     
000020         DATASET-OWNER-----(NULL)     CREATION--------2010.320     
000021         RELEASE----------------2     EXPIRATION------0000.000     
000022         ACCOUNT-INFO-----------------------------------(NULL)     
000023         STATUS------------ACTIVE                                 
000024       SMSDATA                                                     
000025         STORAGECLASS ------SCTST     MANAGEMENTCLASS----MCTST     
000026         DATACLASS ------STANDARD     LBACKUP ---2010.320.2015     
000027       VOLUMES                                                     
000028         VOLSER------------TEP243     DEVTYPE------X'3010200F'     
000029       ASSOCIATIONS                                               
000030         GDG------TTA.TAI23.VRS.CESSDATA                           
000031       ATTRIBUTES                                                 
000032 0NONVSAM ------- [b]TTA.TAI23.VRS.CESSDATA.G0025V00                 [/b]
000033       IN-CAT --- TICFCATC                                         
000034       HISTORY               

Using below sortcard for listing only the filenames in descending order.

Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----
 ****** ***************************** Top of Data ************
 000001  SORT FIELDS=(42,7,CH,D)                               
 000010  INCLUDE COND=(2,7,CH,EQ,C'NONVSAM',AND,18,24,CH,EQ,   
 000020                          C'TTA.TAI23.VRS.CESSDATA.G')
 ****** **************************** Bottom of Data **********   



Which is giving the following op...FB LRECL=120

Code:
Command ===>                                     
----+----1----+----2----+----3----+----4----+----5
********************************* Top of Data ****
0NONVSAM ------- TTA.TAI23.VRS.CESSDATA.G0028V00   
0NONVSAM ------- TTA.TAI23.VRS.CESSDATA.G0027V00   
0NONVSAM ------- TTA.TAI23.VRS.CESSDATA.G0026V00   
0NONVSAM ------- TTA.TAI23.VRS.CESSDATA.G0025V00   
0NONVSAM ------- TTA.TAI23.VRS.CESSDATA.G0024V00   
******************************** Bottom of Data **


Now i want to avoid another sort step to pick up the topmost record if any other options can be added to my above sortcard which will give me only the topmost file name in the above file instead of the listing.

Thanks a ton in adv.
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Thu Nov 18, 2010 11:59 am    Post subject: SYNCSORT version
Reply with quote

Code:
********************************* TOP OF DATA **********************************
 SYNCSORT FOR Z/OS  1.3.2.0R 
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Thu Nov 18, 2010 12:06 pm    Post subject: Reply to: Need single sort card to sort and pick the topmost
Reply with quote

You were given a kind advice on how to post, but You just did not care
Your post was edited to show You the right way of posting screen info


what is that You did not understand in my first answer ???
looks like You only got training in writing but not in reading icon_evil.gif

also Your other post was again edited to make things more readable
the code tags force the browser to use a fixed pitch font,
screen shots, file layouts, sysouts are easier to understand

also You should get training on how not to post employer' related info
just posting the syncsort level would have been enough
Your post was edited to get rid of confidential info
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Thu Nov 18, 2010 12:55 pm    Post subject: Reply to: Need single sort card to sort and pick the topmost
Reply with quote

Thanks for the Shouting Enrico...MY bad...I got it now...!
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Thu Nov 18, 2010 1:44 pm    Post subject: Reply to: Need single sort card to sort and pick the topmost
Reply with quote

once in a while a little shouting helps.. doent' it icon_biggrin.gif icon_biggrin.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Nov 18, 2010 2:05 pm    Post subject:
Reply with quote

How about adding this to your sort card to write the filename into a dataset of FB/LRECL=44
Code:
 OUTFIL ENDREC=1,BUILD=(18,44)
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Thu Nov 18, 2010 6:30 pm    Post subject:
Reply with quote

Thanks a lot Arun!!!! It worked great...Now i have another task which is as below...i think it can be done using inrec/outrec function but not being able to get the desired op. If possible could anybody pls help me once again...

I have the first file as below: FB/115 with first 44 bytes empty.

Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 ****** ***************************** Top of Data ******************************
 000001                               |+000005500000|+000000016527.50|0000000000
 000002                               |+000003575000|+000000007859.92|0000000000
 ****** **************************** Bottom of Data ****************************


And the second file which i got using Arun's code: FB/44

Code:
=COLS> ----+----1----+----2----+----3----+----4----
 ****** ***************************** Top of Data ***
 000001 TTA.TAI23.VRS.CESSDATA.G0028V00               
 000002 TTA.TAI23.VRS.POLMSTR.G0016V00               
  ****** **************************** Bottom of Data *


These two files will always have two records only.

And the op file will be a concatenated one like below: FB/115..LRECLs are now now a bit jeoperdised now but i will adjust them later...

Code:
  =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 ****** ***************************** Top of Data ******************************
 000001 TTA.TAI23.VRS.CESSDATA.G0028V00  |+000005500000|+000000016527.50|0000000000
 000002  TA.TAI23.VRS.POLMSTR.G0016V00       |+000003575000|+000000007859.92|0000000000
 ****** **************************** Bottom of Data ****************************


Any sort card clue for this please?

@Enrico: How's the post this time??? icon_smile.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Thu Nov 18, 2010 7:04 pm    Post subject: Reply to: Need single sort card to sort and pick the topmost
Reply with quote

looks good to me,
the aesthetics at least, for the content You will have to wait for the next episode icon_biggrin.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Nov 18, 2010 9:13 pm    Post subject:
Reply with quote

How are you generating the file-1 (LRECL 115)? How is it related to the data in file-2?

Will both the files always have same number of records? If not, show an example showing all possible input combinations(file-1 rec count > or < file-2 rec count) and expected output out of it.
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Thu Nov 18, 2010 11:00 pm    Post subject:
Reply with quote

Hi Arun,

the file one is a kind of control file containing some total record counts of 2 data op files whose gdg version names will be the first fields of the merged op files.

like in the last screen shot...the first record shows control totals of cessdata file and the second record shows the ctrl record of the polmstr file.
It will be like this everytime just the gdg version names and their corresponding control total values will be different after each run.

I would just have to concatenate these two files every time...Hope this explains.
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Thu Nov 18, 2010 11:05 pm    Post subject:
Reply with quote

I could not get all the required data for my control file from the program (the gdg generation corrected from version names) that y kept the first field empty. Then by idcams listcat i got their names in a different file which now I want to populate in the empty fields of my control file...no other manipulation or combination just simple concatenation.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Nov 19, 2010 5:05 pm    Post subject:
Reply with quote

Is not this a similar topic: http://www.ibmmainframes.com/viewtopic.php?t=52170&highlight=
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Nov 19, 2010 6:42 pm    Post subject:
Reply with quote

Anuj,

It's exactly the same question raised by the OP. Trying multiple options. icon_biggrin.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Nov 19, 2010 6:56 pm    Post subject:
Reply with quote

Quote:
the file one is a kind of control file containing some total record counts of 2 data op files whose gdg version names will be the first fields of the merged op files
ksouren007,

I was asking how or which process generates/writes this control file?

Oops. Sorry Anuj. I just noticed I mispelled your name.
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Fri Nov 19, 2010 9:02 pm    Post subject:
Reply with quote

Exactly...But I want to know about both the ways...Learning doesn't cause any harm i guess icon_smile.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Nov 19, 2010 11:47 pm    Post subject:
Reply with quote

Quote:
But I want to know about both the ways
But you dont seem to be willing to help yourself - by not answering the questions asked.
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Sat Nov 20, 2010 12:25 pm    Post subject: Reply to: Need single sort card to sort and pick the topmost
Reply with quote

1. I have a COBOL program which generates two data files and one control file.

2. the jobstep which runs the program has 3 above o/p files.

3. In the control file whosee structure is is given already LRECL 115 FB has to hold only two records always. The first field of this file will contain the respective GDG file names of the data files generated in that step itself. The other fileds are bing populated through the program. Only the fisrt field has been left blank.

4. In the next steps i take the recent generation of the data files and run IDCAMS listcat and other sort procecesses to get their gdg version names in a diffrent file. LRECL 44 FB.

5. now i just want to fill up the blanks in the original control file with their respective file names.

rest is given as screenshots above. Hope this explains the total process.
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  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


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