Hi Everyone,
Every day, for back-up purpose, we vary offline a large range of devices then do the back-up then put the devices back online.
The Offline/Online part is basically assumed by a MGCR.
We would like to test wether or not the devices are in the desired state,the UCBSCAN macro can retrieve the device's status
from a Volume Serial, but I only have Device Number as Input
Is there any mean to retrieve the volume serial from the device number ?
Retreiving Volume Serial from Device Number
-
- Global moderator
- Posts: 2105
- Joined: Thu Jun 03, 2010 6:21 pm
- Skillset: Assembler, JCL, utilities
- Referer: zos.efglobe.com
Re: Retreiving Volume Serial from Device Number
Provided the volume is online, you can retrieve the volume serial from the UCB returned by UCBSCAN. If the volume is offline ... forget it. You can retrieve the device number from the UCB.
How are you going to backup an offline device??????
How are you going to backup an offline device??????
Re: Retreiving Volume Serial from Device Number
We put the device offline on one LPAR to put it online on another LPAR then we back it up.
But according to what you say, i cannot test wether a device is Offline ?
But according to what you say, i cannot test wether a device is Offline ?
-
- Global moderator
- Posts: 2105
- Joined: Thu Jun 03, 2010 6:21 pm
- Skillset: Assembler, JCL, utilities
- Referer: zos.efglobe.com
Re: Retreiving Volume Serial from Device Number
Look at the UCB definition in IEFUCBOB. Online / offline status is readily available.
Re: Retreiving Volume Serial from Device Number
Thank you, i dit what i need using :
The most difficult part was to "convert" my input from my sysin to binary
e.g my sysin gives me the device numer 794B which is X'F7F9F4C2'
and i need X'794B'.
I managed to convert it by using two TR and MVN
Code: Select all
TM UCBSTAT,UCBONLI
The most difficult part was to "convert" my input from my sysin to binary
e.g my sysin gives me the device numer 794B which is X'F7F9F4C2'
and i need X'794B'.
I managed to convert it by using two TR and MVN
Code: Select all
*- CONVERSION X'F7F4F9FB' ==> X'0709040B'
TR DEVNUM1,HEXTR
*- CONVERSION DE X'0704090B' ==> X'794B'
LA R2,2 R2 = Length of string
LA R3,DEVNUM1 R3 = @ of first digit of DEVNUM1
LA R4,DEVNUM1_B R4 = @ of device number in binary
NEXTCHAR MVC BYTE0+0(2),0(R3) read byte/byte
TR BYTE1,HEXHI
MVN BYTE1,BYTE2
MVC 0(1,R4),BYTE1
LA R3,2(0,R3)
LA R4,1(0,R4)
BCT R2,NEXTCHAR
...
BYTE0 DC 0XL2
BYTE1 DC XL1'00' HIGH-ORDER BYTE
BYTE2 DC XL1'00' LOW-ORDER BYTE
*- Table pour TR :
*-
*- But : change C'794B' X'FFFC' ==> '0000'
*- 7942 749B
*-
HEXTR DC 0CL256
DC XL16'FF' 00-0F
DC XL16'FF' 10-1F
DC XL16'FF' 20-2F
DC XL16'FF' 30-3F
DC XL16'FF' 40-4F
DC XL16'FF' 50-5F
DC XL16'FF' 60-6F
DC XL16'FF' 70-7F
DC XL16'FF' 80-8F
DC XL16'FF' 90-9F
DC XL16'FF' A0-AF
DC XL16'FF' B0-BF
*- -0-1-2-3-4-5-6-7-8-9-A-B-C-D-E-F
DC X'FF0A0B0C0D0E0FFFFFFFFFFFFFFFFFFF' C0-CF
...
*- But : change X'0000' ==> '74'
*- 749B 9B
*-
HEXHI DC 0CL256
*- -0-1-2-3-4-5-6-7-8-9-A-B-C-D-E-F
DC XL16'00102030405060708090A0B0C0D0E0F0' 00-0F
DC XL16'FF' 10-1F
DC XL16'FF' 20-2F
DC XL16'FF' 30-3F
DC XL16'FF' 40-4F
DC XL16'FF' 50-5F
DC XL16'FF' 60-6F
DC XL16'FF' 70-7F
DC XL16'FF' 80-8F
DC XL16'FF' 90-9F
DC XL16'FF' A0-AF
DC XL16'FF' B0-BF
DC XL16'FF' C0-CF
DC XL16'FF' D0-DF
DC XL16'FF' E0-EF
DC XL16'FF' F0-FF
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: Retreiving Volume Serial from Device Number
one translate and one pack instruction are more than enough ...
add one extra byte ...
the pack instruction is pretty dumb and is very good for smart trick
as per POP pack flips the less significant byte and ignores the 4 high order bits of the rest
the first two bytes contain what You ask for
add one extra byte ...
the pack instruction is pretty dumb and is very good for smart trick
as per POP pack flips the less significant byte and ignores the 4 high order bits of the rest
Code: Select all
char hex
input 123a f1f2f3c1
after the translate 0102030a
5bytes for the pack 0102030axy
pack 3bytes,5bytes
3bytes after the pack 123ayx
the first two bytes contain what You ask for
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
Re: Retreiving Volume Serial from Device Number
Your method is way less heavier than mine, thank you 

-
- Global moderator
- Posts: 2105
- Joined: Thu Jun 03, 2010 6:21 pm
- Skillset: Assembler, JCL, utilities
- Referer: zos.efglobe.com
Re: Retreiving Volume Serial from Device Number
The only potential gotcha with Mr. Sorichetti's method is the extra bytes after the after the input and output fields in the PACK instruction. You have to provide the extra byte for the first operand, or save and restore its contents. For the second operand, especially, it's all to easy to S0C4, which has happened to me.
I remember once I was trying to demonstrate the S0C4. After several tries it refused to S0C4 for me. Months later - unintentionally - I got the S0C4!
I remember once I was trying to demonstrate the S0C4. After several tries it refused to S0C4 for me. Months later - unintentionally - I got the S0C4!
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: Retreiving Volume Serial from Device Number
but it could also be done using registers without any intermediate <working storage>
here is a macro for the other way around
here is a macro for the other way around
Code: Select all
MACRO
&NAME $CVRX &R,&LOC,&LEN=8,&WORKREG=14
.*--------------------------------------------------------------------*
.* THIS MACRO CONVERTS THE CONTENTS OF A REGISTER TO HEX DISPLAY *
.* REGISTERS 0,1,14 ARE DESTROYED *
.*--------------------------------------------------------------------*
LCLC &MNAME,&C
AIF ('&LOC'(1,1) EQ '(' AND '&LOC'(K'&LOC,1) EQ ')').A1
&C SETC '&LOC'.'+&LEN' .TARGET NAME IS NOT A REGISTER
AGO .A2
.A1 ANOP
&C SETC '&LEN'.'&LOC'
.A2 ANOP
&MNAME SETC 'IHB'.'&SYSNDX'
&NAME LA 1,&C .TARGET LOW ORDER BYTE
LA 0,&LEN .DO WHILE (R0 > 0 & R0 <= 8)
LR &WORKREG,&R .GET REGISTER CONTENTS
&MNAME.A DS 0H
BCTR 1,0 .AROUND & AROUND
STC &WORKREG,0(1) .WORK ON LOW ORDER NIBBLE
SRL &WORKREG,4 .SHIFT TO NEXT NIBBLE
BCT 0,&MNAME.A .ENDDO
NC 0(&LEN,1),=&LEN.X'0F' .DROP HIGH BITS
TR 0(&LEN,1),=C'0123456789ABCDEF' .TRANSLATE
MEND
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: Retreiving Volume Serial from Device Number
and since I am in a very good mood here is the conversion asked by the TS
tested with
to obtain
Code: Select all
EDIT ENRICO.MACLIB($CVXR) - 01.07 Columns 00001 00072
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 MACRO
000002 &NAME $CVXR &R,&LOC,&LEN=8
000003 .*--------------------------------------------------------------------*
000004 .* THIS MACRO CONVERTS HEX DISPLAY STRING TO A REGISTER *
000005 .* REGISTERS 0,1,14,15 ARE DESTROYED *
000006 .*--------------------------------------------------------------------*
000007 LCLC &MNAME,&C
000008 AIF ('&LOC'(1,1) EQ '(' AND '&LOC'(K'&LOC,1) EQ ')').A1
000009 &C SETC '&LOC' .SOURCE NAME IS NOT A REGISTER
000010 AGO .A2
000011 .A1 ANOP
000012 &C SETC '0'.'&LOC'
000013 .A2 ANOP
000014 &MNAME SETC 'IHB'.'&SYSNDX'
000015 &NAME LA 1,&C .SOURCE LOW ORDER BYTE
000016 BCTR 1,0
000017 LA 0,&LEN .DO WHILE (R0 > 0 & R0 <= 8)
000018 XR 14,14 .CLEAR WORK REG1
000019 XR 15,15 .CLEAR WORK REG2
000020 &MNAME.A DS 0H
000021 LA 1,1(,1) .AROUND & AROUND
000022 XR 15,15 .CLEAR WORK REG2
000023 IC 15,0(1) .WORK ON LOW ORDER NIBBLE
000024 C 15,=F'240' .COMPARE WITH 0 X'F0'
000025 BNL &MNAME.B .IF >= IS A NUMBER
000026 S 15,=F'183' .X'C1' - 183 ==> X'0A'
000027 &MNAME.B DS 0H
000028 N 15,=F'15' .CLEAR HIGH ORDER NIBBLE
000029 SLL 15,28 .SHIFT TO LEFT SIDE OF R15
000030 SLDL 14,4 .SHIFT 4 BITS INTO R14
000031 BCT 0,&MNAME.A .ENDDO
000032 LR &R,14 .TRANSFER RESULT TO DESTINATION
000033 MEND
****** **************************** Bottom of Data ****************************
tested with
Code: Select all
$CVXR 2,F00,LEN=1
$CVXR 2,F00,LEN=2
$CVXR 2,F00,LEN=3
$CVXR 2,F00,LEN=4
$CVXR 2,F00,LEN=5
$CVXR 2,F00,LEN=6
$CVXR 2,F00,LEN=7
$CVXR 2,F00 lenght 8 default
...
...
...
F00 DC C'01234567'
to obtain
Code: Select all
00000000
00000001
00000012
00000123
00001234
00012345
00123456
01234567
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- Similar Topics
- Replies
- Views
- Last post
-
- 0
- 2727
-
by samb01
View the latest post
Thu Feb 04, 2021 6:34 pm
-
- 4
- 4793
-
by willy jensen
View the latest post
Thu Nov 12, 2020 2:40 pm
-
-
compare number lines of two dataset
by samb01 » Wed Nov 13, 2024 8:46 pm » in DFSORT/ICETOOL/ICEGENER - 6
- 2170
-
by sergeyken
View the latest post
Fri Nov 15, 2024 12:41 pm
-