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
 

 

Dataset attributes listing

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Thu Nov 14, 2013 3:54 am    Post subject: Dataset attributes listing
Reply with quote

Hi,

I have some 100+ datasets which I need to find if they are on disk or tape. So I approached my storage management team and found that the disk datasets have device type as X'3010200F'

So my idea is to have all the datasets passed instream to SORT and attach LISTCAT to them and store the entries in an output dataset.

Now I will have the below info for every dataset
Code:

  LISTCAT ENT('TEST.DSN') ALL       
NONVSAM ------- TEST.DSN                 
     IN-CAT --- BCS.GIO.VLB0102                             
     HISTORY                                                 
       DATASET-OWNER-----(NULL)     CREATION--------2013.316
       RELEASE----------------2     EXPIRATION------0000.000
     VOLUMES                                                 
       VOLSER------------C08964     DEVTYPE------X'3010200F' 


From the output dataset I need to extract the dataset name and prepare a list in the output something like below with 3 fields. The dataset name, DEVTYPE(fro above), DISK if DEVTYPE equal to X'3010200F' else TAPE.


Code:

TEST.DSN  X'3010200F'   DISK
TEST.DSN2 X'78048081'  TAPE
TEST.DSN3 X'78048092'  TAPE


I can build sort card for attaching LIST ENT for every input dataset before it goes to IDCAMS to execute LISTCAT. But I need help in handling the output of IDCAMS since the dataset name stays in one line and it's DEVTYPE stays in another line.

Basically I need to group those 2 lines and verify the condition on DEVTYPE and build the final output record.

Can we do this using SORT?

Regards
Amar
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Nov 14, 2013 5:51 am    Post subject: Reply to: Dataset attributes listing
Reply with quote

Use IFTHEN=(WHEN=GROUP to PUSH the DSN onto the subsequent records. IFTHEN=(WHEN=(logical-expression to identify the DEVTYPE and format your output. You can use INCLUDE COND= to get just those two records to start with for each LISTCAT output section, and then OUTFIL INCLUDE= to get the single record of the pair that you want (the first, the DSN, will not be required for your output).
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Fri Nov 15, 2013 8:23 am    Post subject:
Reply with quote

Thank you Very much Bill...
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Nov 15, 2013 1:12 pm    Post subject: Reply to: Dataset attributes listing
Reply with quote

No problem. If you can post your code, it may be helpful to someone else in the future.

I forgot to suggest RECORDS=2 on the WHEN=GROUP, You only have pairs of records, so may as well limit the extent of the PUSH.
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: Fri Nov 15, 2013 1:38 pm    Post subject:
Reply with quote

You might also want to take a look at this old beasty too

http://www.ibmmainframes.com/viewtopic.php?t=57406
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Fri Nov 15, 2013 8:22 pm    Post subject:
Reply with quote

Bill,

Here is the code I've designed.

Code:

SORT FIELDS=COPY                                                     
INCLUDE COND=(1,10,SS,EQ,C'NONVSAM',OR,37,7,CH,EQ,C'DEVTYPE')       
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,10,SS,EQ,C'NONVSAM'),             
       END=(37,7,CH,EQ,C'DEVTYPE'),PUSH=(90:17,44)),                 
     IFTHEN=(WHEN=(37,7,CH,EQ,C'DEVTYPE',AND,52,8,CH,EQ,C'3010200F'),
       BUILD=(1:90,44,C' ',26,06,C' DISK',80:X)),                   
     IFTHEN=(WHEN=(37,7,CH,EQ,C'DEVTYPE',AND,52,8,CH,NE,C'3010200F'),
       BUILD=(1:90,44,C' ',26,06,C' TAPE',80:X))                     
OUTFIL INCLUDE=(53,4,SS,EQ,C'TAPE,DISK'),REMOVECC,                   
       HEADER1=(C'DATE: ',DATE,20:C'DATASETS STATUS REPORT',/,       
                20:C'----------------------'),                       
       HEADER2=(C'DATASET NAME',46:C'VOLUME',53:'TYPE',             
              70:C'PAGE: ',PAGE=(M10,LENGTH=2),/,                   
              1:C'------------',46:C'------',53:'----'),             
       TRAILER2=(20:C'***---PAGE END---***'),BUILD=(1,80)           



Expat,

That was really big code... icon_smile.gif you must have lot of patience to code that much... Or should I say you were in real good mood, like you said in that post? icon_smile.gif


Regards
Amar
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Nov 15, 2013 9:10 pm    Post subject:
Reply with quote

V S Amarendra Reddy wrote:
That was really big code... icon_smile.gif you must have lot of patience to code that much... Or should I say you were in real good mood, like you said in that post? icon_smile.gif


Regards
Amar


You really don't need that much code. You just need to validate device type just once.

try these control cards

Code:

//SYSIN    DD *                                                       
  OPTION COPY                                                         
  INCLUDE COND=(1,10,SS,EQ,C'NONVSAM',OR,37,7,CH,EQ,C'DEVTYPE')       
  INREC IFTHEN=(WHEN=GROUP,BEGIN(1,10,SS,EQ,C'NONVSAM'),               
        PUSH=(81:17,44)),                                             
  IFTHEN=(WHEN=(37,7,CH,EQ,C'DEVTYPE'),                               
  OVERLAY=(125:52,8,CHANGE=(4,C'3010200F',C'DISK'),NOMATCH=(C'TAPE')))
                                                                       
  OUTFIL REMOVECC,NODETAIL,BUILD=(80X),                               
  HEADER2=('DATE: ',DATE,20:'DATASETS STATUS REPORT',/,               
           20:'----------------------',/,                             
           'DATASET NAME',46:C'VOLUME',53:'TYPE',                     
           70:'PAGE: ',PAGE=(M10,LENGTH=2),/,                         
           '------------',46:'------',53:'----'),                     
  TRAILER2=(20:C'***---PAGE END---***'),                               
  SECTIONS=(81,44,                                                     
  TRAILER3=(81,44,46:26,7,53:125,4))                                   
//*                                                                   
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Fri Nov 15, 2013 9:56 pm    Post subject:
Reply with quote

Kolusu,

The code has beautifully worked. I was actually expecting your response icon_smile.gif.


I have few questions on the code.

The group you used doesn't have an END. How did it realize where the group should end? Since my input has GDGs, seq files one after thye another. Eevery GDG will give all the generations and their own volumes which mean their device type.
When the output records being built are only of 80 bytes. How were you able to put data in byte 125.

Also I understood the trailer3 but not the sectiosn part. Can you please explain?

Thank you very much for the code.

Regards
Amar
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Nov 15, 2013 10:51 pm    Post subject:
Reply with quote

V S Amarendra Reddy wrote:
Kolusu,

The code has beautifully worked. I was actually expecting your response icon_smile.gif.


Bill gave enough hints for you to work on and so I just looked at this topic after you posted the solution. It would be easier for you to work on a solution and learn about DFSORT more and we are here to optimize that code you have.

V S Amarendra Reddy wrote:

I have few questions on the code.

The group you used doesn't have an END. How did it realize where the group should end? Since my input has GDGs, seq files one after thye another. Eevery GDG will give all the generations and their own volumes which mean their device type.


Well you used the INCLUDE cond to only include the Dataset name and Device type records. So you will ONLY get the Dataset name records and device type records. For every Dataset name you have device type and hence the end condition is NOT required.

V S Amarendra Reddy wrote:

When the output records being built are only of 80 bytes. How were you able to put data in byte 125.


Look at the OUTFIL statement where I built just 80x ie spaces. That will dictate the LRECL of the output dataset. OUTFIL acts on the final phase so whatever manipulations you do beyond the lrecl you will have access to those variables. Remove the OUTFIL statement and see the sysout and you will notice that the LRECL is 128 bytes.

V S Amarendra Reddy wrote:

Also I understood the trailer3 but not the sectiosn part. Can you please explain?

Thank you very much for the code.


The PUSH from WHEN=GROUP has pushed the dataset name and I used Sections on that so that for every dataset name you have keybreak and we will write out the fields specified in the Trailer3.
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Sat Nov 16, 2013 12:13 am    Post subject:
Reply with quote

Thank you very much Bill, Kolusu. My questions are clarified.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm
No new posts FTOPEN TEMP is failing due to dataset... mbenaud TSO/ISPF 7 Thu Jul 28, 2016 4:28 pm


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