Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Is there any utility to Initialise VSAM file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Mon Sep 03, 2007 9:14 am    Post subject: Is there any utility to Initialise VSAM file
Reply with quote

Hi,

Is there any utility to Initialise VSAM file?

Ony way is to EDIT vsam file, write dummy record in it, save.
Again open the file in EDIT mode, delete the dummy record, save.

But is there any standard utility to do this?


Vikas.
Back to top
View user's profile Send private message

expat

Global Moderator


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

PostPosted: Mon Sep 03, 2007 10:28 pm    Post subject:
Reply with quote

None that I know of.

I have a REXX somewhere that writes low and high value keys into a KSDS, and just leaves them there.

The workdsn is VB 2004

Code:

/* REXX ** POPULATE SELECTED VSAM KSDS WITH HIGH AND LOW HEX KEYS    */

Z = MSG('OFF')
ARG PF US SI .
IF PF = '.' THEN PF = ''
IF US = '.' THEN US = ''
IF SI = '.' THEN SI = ''

WORKDSN = STRIP(PF!!US!!SI!!"WORK")

S1 = "KEYLEN"
S2 = "RKP"
S3 = "REC-TOTAL"
S4 = "MAXLRECL"

"EXECIO * DISKR VSAMFLS ( STEM FLS. FINIS"
DO A = 1 TO FLS.0
  PARSE VAR FLS.A DSN
  DSN = STRIP(DSN)

  CX1 = 0
  CX2 = 0
  CX3 = 0

  X=OUTTRAP(LST.)
  " LISTC ENT('"DSN"') ALL"
  X=OUTTRAP(OFF)

  DO B = 20 TO LST.0

    IF CX1 <> 1 THEN IX1 = POS(S1,LST.B)
    IF CX2 <> 1 THEN IX2 = POS(S2,LST.B)
    IF CX3 <> 1 THEN IX3 = POS(S3,LST.B)

    IF IX1 <> 0 & CX1 <> 1 THEN DO
      KLN = STRIP(TRANSLATE(SUBSTR(LST.B,IX1+6,18),' ','-'))
      CX1 = 1
    END
    IF IX2 <> 0 & CX2 <> 1 THEN DO
      KPS = STRIP(TRANSLATE(SUBSTR(LST.B,IX2+6,18),' ','-'))
      RL1 = POS(S4,LST.B)
      RLN = STRIP(TRANSLATE(SUBSTR(LST.B,RL1+8,16),' ','-'))
      CX2 = 1
    END
    IF IX3 <> 0 & CX3 <> 1 THEN DO
      RCS = STRIP(TRANSLATE(SUBSTR(LST.B,IX3+9,15),' ','-'))
      CX3 = 1
    END

    IF CX1 & CX2 & CX3 THEN DO
      B = LST.0
      IF RCS <> 0 THEN DO
        SAY "RECORDS COUNT GT 0 FOR "DSN
        ITERATE A
      END
      "FREE  FI(WORK,VSAM)"
      "ALLOC FI(WORK) DA('"WORKDSN"') SHR"
      "ALLOC FI(VSAM) DA('"DSN"') SHR"
      IF KPS > 0 THEN AA = LEFT(' ',KPS)!!COPIES('00'X,KLN)
       ELSE AA = COPIES('00'X,KLN)
      QUEUE AA
      IF KPS > 0 THEN AA = LEFT(' ',KPS)!!COPIES('00'X,KLN)
       ELSE AA = COPIES('FF'X,KLN)
      QUEUE AA
      "EXECIO" QUEUED() "DISKW WORK ( FINIS"
      "FREE  FI(WORK)"
      "ALLOC FI(WORK) DA('"WORKDSN"') SHR"
      " REPRO IFILE(WORK) OFILE(VSAM) "
      SAY "RETURN CODE "RIGHT(RC,4)" FOR "DSN
      "FREE  FI(WORK,VSAM)"
      ITERATE A
    END
  END
END
Back to top
View user's profile Send private message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Wed Sep 05, 2007 11:31 am    Post subject:
Reply with quote

Sorry Expat,

I don't EXX.

Thanks,

Vikas.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Sep 05, 2007 10:35 pm    Post subject:
Reply with quote

VIKAS GAIKWAD wrote:
Sorry Expat,

I don't EXX.

Thanks,

Vikas.


You don't need to, I've written it for you icon_rolleyes.gif

All you need to do is to write the JCL to execute it.

I have stated what is required for the work file, VB 2004
and DD VSAMFLS contains a list of the files that you want initialise.

You can remove the lines below

ARG PF US SI .
IF PF = '.' THEN PF = ''
IF US = '.' THEN US = ''
IF SI = '.' THEN SI = ''

And replace

WORKDSN = STRIP(PF!!US!!SI!!"WORK")

with

WORKDSN = "the name of the dataset allocated to DD WORK"

and it should work
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Where to get sample for processing RM... vice_versa PL/I & Assembler 2 Tue Jan 16, 2018 2:03 pm
No new posts VSAM dataset not found abdulrafi JCL & VSAM 5 Fri Jan 12, 2018 11:19 am
No new posts Utility for search operation Gopalakrishna551 TSO/ISPF 11 Wed Jan 03, 2018 11:07 am
No new posts COB2 file processing rizwanaccy COBOL Programming 8 Tue Jan 02, 2018 1:00 pm
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us