I want to extract the Load module name from following ouput
I know in REXX i can do somthing like :
So what is the corresponding code in assambly to do that ? Thanks
Code:
DO I =1 TO UL0.0
IF SUBSTR(UL0.I,1,7)='PDS232I' THEN DO
IF SUBSTR(UL0.I,9,4) <>'NAME' THEN
QUEUE SUBSTR(UL0.I,8,8)
END
END
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
Actually, this is a silly request. Most Assembler programmers would just read the PDS directory directly, not mess around with getting a directory listing and then checking the listing.
Code:
OPEN (DIR,INPUT)
DIR0100 GET DIR
LH 5,0(,1)
AR 5,1
BCTR 5,0
LA 3,2(,1)
USING PDS2,3
DIR0200 CLC =FL8'-1',PDS2NAME
BE EOF
CLC =CL8'xxx',PDS2NAME
BNE DIR0300
... Process the directory entry
DIR0300 IC 4,PDS2INDC
N 4,=A(PDS2LUSR)
LA 4,(PDS2USRD-PDS2)(4,4)
BXLE 3,4,DIR0200
B DIR0100
EOF ...
...
DIR DCB DSORG=PS,MACRF=GL,DDNAME=...,EODAD=EOF,
RECFM=F,LRECL=256,BLSIZE=256
...
IHAPDS PDSBLDL=NO
The IHAPDS macro is in SYS1.MODGEN, and has all the standard symbols for load module entries.
In the code, reg 3 points to the current directory entry, and register 5 points to the last used data byte in the directory block. The code starting at DIR0300 computes the length of the directory entry. The 5 low order bits in PDS2INDC define the number of 2 byte elements of user data in the directory entry. LA 4,(PDS2USRD-PDS2)(4,4) takes this value, multiplies it by 2, and adds the length of the member name and TTRC data areas to get the complete length of the directory entry.
LOOP GET INPUT
USING INREC,1
CLC MSGID,=C'PDS232I'
BNE LOOP
...
B LOOP
In this snippet, the DCB used to read the input data set is defined as using “locate” mode I/O, wheret the GET macro returns a record address to your program in reg 1. This scheme works well only if the input data is more or less fixed.
Examine the data more directly.
Code:
LOOP GET INPUT
CLC =C'PDS232I',0(1)
BNE LOOP
...
B LOOP
As in the first snippet, the GET macro returns a record address in reg 1. This scheme is more useful if the record contents are more vaiable.Jack, before you go any further: