IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort - Need crtain data from liscat cmd in a PS to o/p


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Tue Jan 06, 2009 11:09 am
Reply with quote

Code:

Command ===>                                                  Scroll ===> CSR 
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000001 1IDCAMS  SYSTEM SERVICES                                           TIME:
000002 0GDG BASE ------ PDSCU.CFX.BMEIAZ00                                     
000003       IN-CAT --- SYS3C.ICFCAT3E.IPCCAT01                               
000004       HISTORY                                                           
000005         DATASET-OWNER-----(NULL)     CREATION--------1998.002           
000006         RELEASE----------------2     LAST ALTER------2009.001           
000007       ATTRIBUTES                                                       
000008         LIMIT------------------3     SCRATCH          NOEMPTY           
000009       ASSOCIATIONS                                                     
000010         NONVSAM--PDSCU.CFX.BMEIAZ00.G0130V00                           
000011         NONVSAM--PDSCU.CFX.BMEIAZ00.G0131V00                           
000012         NONVSAM--PDSCU.CFX.BMEIAZ00.G0132V00                           
000013 0   NONVSAM ---- PDSCU.CFX.BMEIAZ00.G0130V00                           
000014       IN-CAT --- SYS3C.ICFCAT3E.IPCCAT01                               
000015       HISTORY                                                           
000016         DATASET-OWNER-----(NULL)     CREATION--------2008.306           
000017         RELEASE----------------2     EXPIRATION------0000.000   
000018         ACCOUNT-INFO-----------------------------------(NULL)           
000019         STATUS------------ACTIVE                                       
000020       SMSDATA                                                           
000021         STORAGECLASS ---SC000404     MANAGEMENTCLASS-MI003600           
000022         DATACLASS --------(NULL)     LBACKUP ---XXXX.XXX.XXXX           
000023       VOLUMES                                                           
000024         VOLSER------------MIGRAT     DEVTYPE------X'78048081'     FSEQN-
000025       ASSOCIATIONS                                                     
000026         GDG------PDSCU.CFX.BMEIAZ00                                     
000027       ATTRIBUTES                                                       
000028 0   NONVSAM ---- PDSCU.CFX.BMEIAZ00.G0131V00                           
000029       IN-CAT --- SYS3C.ICFCAT3E.IPCCAT01                               
000030       HISTORY                                                           
000031         DATASET-OWNER-----(NULL)     CREATION--------2008.336           
000032         RELEASE----------------2     EXPIRATION------0000.000           
000033         ACCOUNT-INFO-----------------------------------(NULL)           
000034         STATUS------------ACTIVE                                       
000035       SMSDATA                       


The above is a portion of the data in a PS. It has the attributes of DCB=(RECFM=VBA,LRECL=125,DSORG=PS

The output from this dataset is needed in a dataset with attributes of RECFM=FB,LRECL=45,DSORG=PS

We have the input file like the one above. It contains the listcat entries. We have to check the entries with GDG base, then we need to see all the generations of that base which would be preceded with NOVSAM. We have to find out the latest generation (i.e. the one with the highest generation number) & copy this to the output dataset. This needs to be repeated for all the GDG bases
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Jan 06, 2009 11:15 am
Reply with quote

Quote:
This needs to be repeated for all the GDG bases
Do you want to do this for a number of GDG bases?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jan 06, 2009 12:23 pm
Reply with quote

If you specify gdg.base(0) as the input to your copy step then you will always get the latest generation.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Jan 06, 2009 12:50 pm
Reply with quote

expat,

I think he's trying to copy the latest generation number to the output dataset. In the above example, output might be
Code:
PDSCU.CFX.BMEIAZ00.G0132V00


Vikram,

Please explain what exactly you're trying to do.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jan 06, 2009 12:54 pm
Reply with quote

Yeah, I know, just seeing who is 'on the ball' today icon_redface.gif
Back to top
View user's profile Send private message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Tue Jan 06, 2009 3:51 pm
Reply with quote

Quote:

expat,

I think he's trying to copy the latest generation number to the output dataset. In the above example, output might be Code:
PDSCU.CFX.BMEIAZ00.G0132V00


Vikram,

Please explain what exactly you're trying to do.



Yes, you are right we will have the output as you said in your post. But here we have a number of GDGs' so in the output we will have a number of the latest generation of GDGs'. So we have to check the GDG base first and then to the line which says NOVSAM to find the latest generation and then write that in output.[/code]
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jan 06, 2009 4:05 pm
Reply with quote

Here is some code that I have posted previously and will determine the latest GDG generation.

You will need to include it in a loop to process all of the gdg bases in your list. The output will be gdg.base.name.G0000V00 if no generations exist.
Code:

GDG = "gdg base name" 
DSN = STRIP(GDG||".G0000V00")
X=OUTTRAP(LST.) 
" LISTC ENT('"GDG"')"                             
X=OUTTRAP(OFF)                                   
DO A = LST.0 TO 1 BY -1 
  IF POS('NONVSAM',LST.A) > 0 THEN DO             
    DSN = SUBSTR(LST.A,POS('NONVSAM',LST.A)+13,44)
    A = 0                                         
  END                                             
END                                               
SAY "LATEST GEN IS " DSN
Back to top
View user's profile Send private message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Wed Jan 07, 2009 7:36 am
Reply with quote

I think the above is for a single GDG base. I have a number of GDG bases here & i want to repeat the process for all the bases.

Also in the output i dont want-"The output will be gdg.base.name.G0000V00 if no generations exist". In such a case there should not be anything that should be written for that GDG base.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jan 07, 2009 8:59 am
Reply with quote

Hello,

Quote:
I think the above is for a single GDG base. I have a number of GDG bases here & i want to repeat the process for all the bases.

Suggest you read the text Expat posted as well as the code Expat posted. . .
Quote:
You will need to include it in a loop to process all of the gdg bases in your list.



Quote:
Also in the output i dont want-"The output will be gdg.base.name.G0000V00 if no generations exist". In such a case there should not be anything that should be written for that GDG base.
Then write code to do what you want. People here will help when you have questions/problems, but will not do the work for you.
Back to top
View user's profile Send private message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Wed Jan 07, 2009 9:44 am
Reply with quote

thanks a lot dick
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jan 07, 2009 9:53 am
Reply with quote

You're welcome icon_smile.gif

Someone will be here if there are questions/problems with the code.

d
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Jan 07, 2009 9:54 am
Reply with quote

Vikram,

The code posted by expat can be modified slightly to achieve what you want. Just you need to put some logic to make it work your way. Try doing that and if you come across any errors, post it here. Somebody will be here to help. Good luck icon_smile.gif
Back to top
View user's profile Send private message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Thu Jan 08, 2009 10:27 am
Reply with quote

I think this problem can be simplified - from the liscat entries i have taken the lines with NONVSAM in a different dataset as follows

Code:

NONVSAM--PDSCU.CFX.BMEIAZ00.G0130V00
NONVSAM--PDSCU.CFX.BMEIAZ00.G0131V00
NONVSAM--PDSCU.CFX.BMEIAZ00.G0132V00
NONVSAM--PDSCU.CFX.BMEIHD00.G0165V00
NONVSAM--PDSCU.CFX.BMEIHD00.G0166V00
NONVSAM--PDSCU.CFX.BMEIHD00.G0167V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0172V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0173V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0174V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0175V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0176V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0177V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0178V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0179V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0180V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0181V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0182V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0183V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0184V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0185V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0186V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0187V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0188V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0189V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0190V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0191V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0192V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0193V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0194V00
NONVSAM--PDSCU.CFX.BMEIKJ00.G0195V00


Now in this i want only the latest generation of the of the dataset for the GDG bases in the putput dataset. The output should be as follows. I need to do this by SORT.

Code:

PDSCU.CFX.BMEIAZ00.G0132V00
PDSCU.CFX.BMEIHD00.G0167V00
PDSCU.CFX.BMEIKJ00.G0195V00


Can this be done using SORT?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jan 08, 2009 10:36 am
Reply with quote

Hello,

Which sort product is used on your system?

This may make a difference as to which part of the forum the topic is located. Syncsort would stay here. DFSORT would be moved to the DFSORT part of the forum.
Back to top
View user's profile Send private message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Thu Jan 08, 2009 10:41 am
Reply with quote

Hi,

My system uses SYNCSORT FOR Z/OS 1.2.3.1R
Back to top
View user's profile Send private message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Thu Jan 08, 2009 4:16 pm
Reply with quote

To further simplify. I have the input dataset as

PDSCU.CFX.BMEIAZ00.G0130V00
PDSCU.CFX.BMEIAZ00.G0131V00
PDSCU.CFX.BMEIAZ00.G0132V00
PDSCU.CFX.BMEIHD00.G0165V00
PDSCU.CFX.BMEIHD00.G0166V00
PDSCU.CFX.BMEIHD00.G0167V00
PDSCU.CFXAT.BMEIFRC2.G0144V00
PDSCU.CFXAT.BMEIFRC2.G0145V00
PDSCU.CFXAT.BMEIFRC2.G0146V00
PDSCU.CFXBU.BIEPLA01.G0169V00
PDSCU.CFXBU.BIEPLA01.G0170V00
PDSCU.CFXBU.BIEPLA01.G0171V00
PDSCU.CFX.BMEIMM00.G0168V00
PDSCU.CFX.BMEIMM00.G0169V00
PDSCU.CFX.BMEIMM00.G0170V00


So the output dataset should contain the latest generation of the above, so it should contain
Code:

PDSCU.CFX.BMEIAZ00.G0132V00
PDSCU.CFX.BMEIHD00.G0167V00
PDSCU.CFXAT.BMEIFRC2.G0146V00
PDSCU.CFXBU.BIEPLA01.G0171V00
PDSCU.CFX.BMEIMM00.G0170V00
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Jan 09, 2009 7:58 am
Reply with quote

Vikram,

Since you have GDG bases of different lengths, you might want to use the PARSE function to achieve this. PARSE is supported by SyncSort for z/OS Release 1.3
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Jan 09, 2009 8:04 am
Reply with quote

Vikram,

I just noted that you're having an older version of SyncSort. So I would suggest you to convince your manager to use the bit of working code already suggested here. Or use a big sort card having a series of IFTHENs.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top