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
 
How to read a dynamically generated VOLSER as PARM

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

New User


Joined: 23 Dec 2006
Posts: 10
Location: SYDNEY

PostPosted: Tue Apr 03, 2007 8:07 pm    Post subject: How to read a dynamically generated VOLSER as PARM
Reply with quote

Dear All,

I have a query related to VOLSER (Volume Serial) of a tape.

Situation : A dataset is archived to a tape where the VOLSER is dynamically generated. I need to retreive the VOLSER number and write into a VSAM file.

Questions:

1) How to define the 'VOLSER' parameter for dynamic allocation?
2) Is there any utility to get the VOLSER of a tape?
3) Can I pass the VOLSER to another step as PARM, so that a program can read the PARM and write into a VASM file.

Thank you
Regards

Anil
Back to top
View user's profile Send private message

itzphaniz

New User


Joined: 02 Sep 2005
Posts: 39

PostPosted: Tue Apr 03, 2007 8:13 pm    Post subject:
Reply with quote

Buddy-

even i had similar requirement. Please go thru this link. hope it is of some help.

http://ibmmainframes.com/viewtopic.php?t=19300&highlight=
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Tue Apr 03, 2007 9:46 pm    Post subject:
Reply with quote

Hello,

Is the archived file on a tape that is a collection of archives or is archived separately?

If it is archived separately, all you will need is to query the tape management system or do a LISTCAT to get the volser.

What will the entry in the vsam file be used for? Usually, volser info for an archive is not stored directly in an external file. What happens when the archive is rebuilt and the volser changes?
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 Apr 04, 2007 12:38 pm    Post subject:
Reply with quote

What do you mean that the VOLSER is dynamically generated ? All that happens is that the job selects a scratch tape from the pool and uses that tape.

Do you know the DSN being generated by your job, and is it catalogued ? If so, you can easily get the VOLSER by a utility such as IDCAMS.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Wed Apr 04, 2007 1:40 pm    Post subject:
Reply with quote

Hi bvanilkumar !

Just one hint to your Top-3

You could add a step with a little programm that only opens and closes this tape, you created one step before. This programm must be a little assembler-pgm which is using the RDJFCB macro for reading the internal JobFileControlBlock of the JCL. Then you can extract the actual informations for that file. Like DatasetName, VolSer and so on. By looking at IOJFCB-DSECT, you could see all the internal FieldDefinitions where the Informations are stored in and where you could get them from.

Regards, UmeySan

Example for coding. The infile here is declared and named KTONDCB and the DD in the JCL for that file is HUGO.


*
USING IOJFCB,R5
RDJFCB KTONDCB ...macro-call rdjfcb
*
L R5,=A(KTONFCB) ...INIT SYSTEM-BLOCK FCB
MVC KTONNAM(44),JFCBDSNM ...MOVE DATASET-NAME
MVC KTONMEM(08),JFCBELNM ...MOVE MEMBER-NAME

.... move the desired informations to a list-output ore store them
anywhere you want

DROP R5
*

File-Definition

SPACE
KTONDCB DCB DDNAME=HUGO,
DSORG=PS,MACRF=GL,EXLST=KTONLST
SPACE
SPACE
DS 0F
KTONNAM DC CL44' ' ...Area DATASET-NAME
KTONMEM DC CL08' ' ...Area MEMBER-NAME
KTONVLS DC CL01' ' ...Area Count of VOLUMES
KTONVOL DC CL30' ' ...Area VOUME-NUMBERS
SPACE
DS 0F
KTONLST DC X'87' ...EXLST FUER RDJFCB
DC AL3(KTONFCB) ...ADRESS FUER RDJFCB
SPACE
DS 0F
KTONFCB DS 176C ...RETURN-Area FUER RDJFCB
SPACE
PRINT ON,NOGEN


Definition for the RDJFCB

PRINT ON,GEN
SPACE
IOJFCB DSECT
IEFJFCBN LIST=YES
SPACE
PRINT ON,NOGEN
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 Apr 04, 2007 1:49 pm    Post subject:
Reply with quote

UmeySan

Do you think it is a good idea for applications programmers to be chasing system control blocks, because I do not.

Don't forget that some applications programs need to be run from an APF authorised library. I shudder to think the damage a mis coded instruction may cause.

What is wrong with using the catalog structure to record the details of the tape and its use, from which the information can so easily be found and subsequently used.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Wed Apr 04, 2007 2:26 pm    Post subject:
Reply with quote

Hi expat !

There's nothing wrong with your idea of using the catalog ore some other TapeManagementSystems.

But as a Systemprogrammer, i had been in some situations, where the using of a RDJCFB-call had been a suitable and neat solution for a problem. Also in former times, this was a standard practice for creating
legalized documents for the exchange of tapes beetween banks in europe.

But i agree with you, you have to be shure of what your'e doing.

Have a nice easter-weekend & regards,
UmeySan
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 Apr 04, 2007 2:33 pm    Post subject:
Reply with quote

Quote:
Have a nice easter-weekend & regards,
UmeySan

Looks like you're having a nice lonnnnnnnnnnng weekend then.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Wed Apr 04, 2007 3:17 pm    Post subject:
Reply with quote

Yes Sir, expat !

From today 15hundred zulu time till 12/04/07 08hundred.
And in fact of information, the wether will become fine.
So i hope most of the girls would only be lightly dressed !!!

Prettige paasdagen & regards,
UmeySan (Frankfurt am Main / Germany)
Back to top
View user's profile Send private message
mainframe_96

New User


Joined: 18 Dec 2006
Posts: 13
Location: usa

PostPosted: Thu Apr 05, 2007 8:00 pm    Post subject: Re: How to read a dynamically generated VOLSER as PARM
Reply with quote

Hope this helps

Code:
PYVSNO   CSECT                                                          00000010
PYVSNO   AMODE ANY           ADDRESSABILITY FOR CALLING MODULE          00000200
PYVSNO   RMODE 24            RESIDENCY MODE FULL ADDRESSABILITY         00000301
         ESTAB 12                                                       00000020
         B     PASTSETU      BRANCH PAST CONSTANTS                      00000402
         SETUP               CONSTANTS FOR DATE TIME OF LAST ASSEMBLE   00000402
PASTSETU EQU   *                                                        00000402
         LR    3,1                                                      00000030
         L     4,0(3)      ADDRESS OF DCB                               00000040
         MVC   DCBADDR,0(4)                                             00000050
         LA    4,DCBADDR                                                00000060
         USING IHADCB,4                                                 00000070
         LA    5,JFCB                                                   00000080
         MVC   DCBEXLST+1(3),=AL3(PARMLST)                              00000090
         ST    4,JFCB                                                   00000100
         MVC   LABEL(3),JFCB+1                                          00000110
         RDJFCB (4)                                                     00000120
LABEL    EQU   *-5                                                      00000130
         L     6,4(3)                                                   00000140
         XR    7,7                                                      00000150
         IC    7,JFCB+117              LOAD NO OF VOL SERS              00000160
         STH   7,0(6)                  STORE IN FIRST 2 CHARS OF PARM   00000170
         MVC   2(30,6),JFCB+118        MOVE FIRST FIVE VOL SERS         00000180
         MVC   38(44,6),JFCB           MOVE DSN TO PARM AREA            00000190
         MVC   DCBEXLST+1(3),=AL3(0)                                    00000200
         UNESTAB                                                        00000210
         DS    0D                                                       00000220
         PRINT GEN                                                      00000230
PARMLST  DC    A(*+4)                                                   00000240
         DC    X'07'                                                    00000250
         DC    AL3(JFCB)                                                00000260
         DC    X'80'                                                    00000270
         DC    AL3(0)                                                   00000280
JFCB     DS    CL176                                                    00000320
DCBADDR  DS    CL200                                                    00000330
         LTORG                                                          00000340
         PRINT NOGEN                             00000350
         DCBD DSORG=PS                                                  00000360
         END                                                            00000370[code][/code]
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 is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 5 Sat Aug 19, 2017 2:33 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm

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