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

PDS record layout when RECFM=U


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Sep 14, 2011 6:12 pm
Reply with quote

Hi,

There is a PDS with LRECL 80 and FB.
When the PDS was read with RECFM=U and then written 'as is' into a output dataset it looked like,
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
----+----F----+----F----+----F----+----F----+----F----+----F----+----F----+----F
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
 ------------------------------------------------------------------------------
********************************* Top of Data **********************************                                                                               
 ------------------------------------------------------------------------------
.ÚMEMBER1 .......ç...|...|........USERID1   MEMBER2 ...........|...|........USER
0FDCDCCDF4001000040114011402010000EECDCCF444DCDCCDF4002000010114011403000000EECD
0E4542591002DF1108119F119F77060000425994100045425920021F1001119F119F700C0C004259
 ------------------------------------------------------------------------------
ID1   MEMBER3 .......á...?...?........USERID1   MEMBER4 ........................
CCF444DCDCCDF4001000040126012602010100EECDCCF444DCDCCDF4000000020112011200010100
9410004542593003EF1105111F111F460A080042599410004542594001EF1004115F115F35000000
 ------------------------------------------------------------------------------
USERID1   MEMBER5 ........................USERID1   MEMBER6 ....................
EECDCCF444DCDCCDF4001000010112011201000100EECDCCF444DCDCCDF400100000011201120101
425994100045425950027F1209119F119F560C0800425994100045425960011F1107115F115F420B

the output records seems to have some record layout which contains the PDS member statistics. Is it correct?
If so could you please point me to the place/link which has the record structure and more information. Thanks.

This task has no business need, processing the PDS data was a part of 'reading different external files using SAS'.
Thanks for viewing.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Sep 14, 2011 6:24 pm
Reply with quote

what You posted is just the directory of a pds read as a PS dataset

for the ispf statistics see here
www.sillysot.com/ftp/mlrexx.txt
quick and dirty link,
look at the ispf manuals for the complete explanation for the statistics section
at the MVS data management manuals the general directory entry layout
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Sep 14, 2011 6:58 pm
Reply with quote

Hello Enrico,
Thanks for the REXX solution (happy that it was not a cobol or assembler),
I will try to translate the REXX to SAS.

Regards,
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Sep 14, 2011 7:32 pm
Reply with quote

vasanthz, find member PDSLIST of your site's SAS SAMPLE library. This contains SAS code to read PDS directory entries. IIRC, there is also SAS code on the SAS support web site that allows you to read every member of a PDS without having to specify the members.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Sep 14, 2011 7:55 pm
Reply with quote

Hello Robert, Thanks for the pointer.
Did not knew until now that there was a sample library for SAS programs.
after a bit of searching, found the PDSLIST member.
I think I would look at the member once completing my exercise, else the sample program would become a spoiler.

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

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Sep 21, 2011 4:38 pm
Reply with quote

Hi,

On the link provided by Enrico,
There are a set of REXX statements like,
Code:
(decoding the PDS statistics present inside the variable "direntry")
  Parse Var direntry,
    vv 2 mm 3 flags 4 ss 5 crecc 6 crdate 9 modcc 10 moddate 13 hh,
    14 tm 15 lines 17 init 19 mod 21 userid 28 .
  Parse Value c2x(crdate)  with cyy 3 cjjj 6 .
  out=out 19+c2x(crecc)cyy'.'cjjj                 /* Create date   */

So I tried some equivalent SAS statemets like,
Code:
(decoding the PDS statistics present inside the variable "STATS")
CRECC  = INPUT(SUBSTR(STATS,5,1),PIB1.) + 19;    /* CREATED CENTURY */
CRDATE = INPUT(SUBSTR(STATS,6,3),PIB3.);            /* CREATED DATE */

For a PDS memeber that was created today,
The CRECC on SAS output was 20 (Correct)
The CRDATE on SAS output was 1123919(?).

I was expecting CRDATE member to have 11264(Julian date for today) but output was 1123919.
Could you please let me know where the issue could be?

Trial program:
Code:

DATA GO;                                                             
INFILE 'WELLS.SOME.PDS' LRECL=256 BLKSIZE=256;                   
LENGTH BLOCK1 BLOCK2 BLOCK3 $256 STATS $30;                           
INPUT  @1 BLOCK1 $256.;                                               
IF _N_ = 1;                                                           
BL1 = INPUT(SUBSTR(BLOCK1,1,2),PIB2.);              /* BLOCK LENGTH */
BLOCK2 = SUBSTR(BLOCK1,3);             /* BLOCK LENGTH PART REMOVED */
NAME   = SUBSTR(BLOCK2,1,8);                         /* MEMBER NAME */
TTR    = SUBSTR(BLOCK2,9,3);                          /* DON'T KNOW */
C      = SUBSTR(BLOCK2,12,1);                 /* SOME IMPORTANT BIT */
BLOCK3 = SUBSTR(BLOCK2,13);                                           
STATS  = SUBSTR(BLOCK3,1,30);                  /* MEMBER STATISTICS */
CRECC  = INPUT(SUBSTR(STATS,5,1),PIB1.) + 19;    /* CREATED CENTURY */
CRDATE = INPUT(SUBSTR(STATS,6,3),PIB3.);            /* CREATED DATE */
USERID = SUBSTR(STATS,21,8);                              /* USERID */
PUT CRDATE= CRECC= USERID= NAME=;                                     
RUN;                                                                 


Thanks & Regards,
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Sep 21, 2011 4:59 pm
Reply with quote

Got the error,
Changing
Code:
CRDATE = INPUT(SUBSTR(STATS,6,3),PIB3.);            /* CREATED DATE */

to
Code:
CRDATE = INPUT(SUBSTR(STATS,6,3),PD3.);

resolved the issue.
Thanks anyway.
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 Sep 21, 2011 7:35 pm
Reply with quote

Hi Vasanth,

Good to hear it is working - thank you for letting us know icon_smile.gif

d
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top