Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
I am in a shop where all of the databases are set up with KSDS IAM organization and 'modeled' to appear just like an IMS database. There is some inhouse software here where they have acheived the functionality of IMS commands like 'GN', 'GHU' against these DBs. Example follows:
So the base in this case is:
Code:
Command ===> Scroll CSR
Key 'AT0000101 1' Type KSDS IAM RBA <IAM FILE> Format SNGL
Top Line is 1 of 165
Current 01: ADROOT Length 341
Field Picture Typ Len Data
ADROOT-VK-ADV-NO X(9) AN 9 AT0000101
FILLER X(6) AN 6
ADROOT-VK-REC-TYPE
X AN 1 1
ADROOT-WHOFSUP XX AN 2 AT
ADROOT-NUMBER 99999 ZD 5 1
ADROOT-PAGE 99 ZD 2 1
ADROOT-STATUS 99 ZD 2 30
ADROOT-ADDDATE S9(7) PD 4 1120319
ADROOT-PCKDATE S9(7) PD 4 0
ADROOT-WEIGHT S9(6)V999 PD 5 0.800
ADROOT-BASEIND X AN 1 0
ADROOT-SLCRIT S9(7) PD 4 109605
ADROOT-TOTORD S9(7) PD 4 1
ADROOT-INVMU XX AN 2
and a segment is:
Code:
Top Line is 1 of 100
Current 01: ADLINE Length 391
Field Picture Typ Len Data
ADLINE-VK-ADV-NO X(9) AN 9 AT0000101
ADLINE-VK-KEYCOM X AN 1 2
ADLINE-VK-SEQ-NO X(5) AN 5 00100
ADROOT-VK-REC-TYPE
X AN 1 2
ADLINE-CSEQNO 9(5) ZD 5 100
ADLINE-ORDMU XX AN 2 US
ADLINE-ORDNO S9(7) PD 4 7182117
ADLINE-SEQNO S9(7) PD 4 2200
ADLINE-ORDTYPE 99 ZD 2 6
ADLINE-ORDPART X(21) AN 21 20870709
ADLINE-RECTYPE 9 ZD 1 1
ADLINE-ORDQTY S9(7) PD 4 0
ADLINE-SUPPART X(21) AN 21 20870709
ADLINE-USER X(20) AN 20 ~+111BEL
I am currently working with the ADLINE database (above). I posted a question yesterday which frank so kindly replied too. In that post was the INREC command
which got me to the first field in the ADLINE db ( turned out to be 9 and not 4 bytes). After fiddling around with the JCL and several errors I found ( with the help of QW ( bless it's soul)) the following command would get me to the first field in the IAM file and gave a report of 8 bazillion of them ( had to purge the job). But, it worked.
I didn't know what the ENDBEFR=C',' and the 1,4 in
BUILD=(1,4,%01) were and still that is kinda vague.
my Question is:
since I got to the 1st data field by using the ENDBEFR and the BUILD=(1,4 am i faced with using that exact combination when getting the next 'n' of fields for output or can I just end that noise and continue with FIXLEN=(%02 ?
the output that I need is just the data in the fields in a readable format. I can figure that one out, I just need the direction to get the rest of the data in the record one field at a time.
Thanks
[/code]
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
I didn't know what the ENDBEFR=C',' and the 1,4 in
BUILD=(1,4,%01) were and still that is kinda vague.
ENDBEFR=C',' says to stop extracting the field at the first comma.
BUILD=(1,4,%01) specifes the output records should have the RDW (required for VB records) and the data extracted into the %01 parsed field.
However, I'm a little confused. The structure you show for the database seems to have fixed-length fields, not delimited fields. For example, the first few fields of your record would look like this according to your structure:
Code:
AT0000101 1AT000010130
Those are NOT delimited fields and don't require PARSE to handle.
For delimited fields requiring PARSE, I would expect something like this:
Code:
AT0000101,,1,AT,00001,01,30
Perhaps my answer was to a question you didn't ask correctly?
Perhaps you should start over and explain exactly what you're trying to do so I can help you do it correctly.
Please show an example of the records in your input file (relevant fields only) and what you expect for output. If the fields are fixed length, show that in the example. If the fields are delimited, show that in the example. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input file.
Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
son of a gun, i have been misled (new here ).
3.2 shows
Code:
Data Set Name . . . . : VF.SPM.VADVNDB
General Data Current Allocation
Management class . . : **None** Allocated cylinders : 2,841
Storage class . . . : **None** Allocated extents . : 3
Volume serial . . . : POP007 +
Device type . . . . : 3390
Data class . . . . . : **None**
Organization . . . : PS Current Utilization
Record format . . . : F Used cylinders . . : 2,841
Record length . . . : 0 Used extents . . . : 3
Block size . . . . : 13682
1st extent cylinders: 777
Secondary cylinders : 300 Dates
Data set name type : Creation date . . . : 1998/04/05
SMS Compressible. . : NO Referenced date . . : 2012/03/21
Expiration date . . : ***None***
Input is fixed Length not delimited:
Code:
Key AT00002012001002 Type KSDS IAM RBA <IAM FILE> Format SNGL
Top Line is 1 of 100
Current 01: ADLINE Length 391
Field Picture Typ Len Data
ADLINE-VK-ADV-NO X(9) AN 9 AT0000201
ADLINE-VK-KEYCOM X AN 1 2
ADLINE-VK-SEQ-NO X(5) AN 5 00100
ADROOT-VK-REC-TYPE
X AN 1 2
ADLINE-CSEQNO 9(5) ZD 5 100
ADLINE-ORDMU XX AN 2 US
ADLINE-ORDNO S9(7) PD 4 7185482
ADLINE-SEQNO S9(7) PD 4 200
ADLINE-ORDTYPE 99 ZD 2 2
ADLINE-ORDPART X(21) AN 21 21633320
ADLINE-RECTYPE 9 ZD 1 1
ADLINE-ORDQTY S9(7) PD 4 0
ADLINE-SUPPART X(21) AN 21 21633320
ADLINE-USER X(20) AN 20
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Ok, so now you have to decide on/explain the rules for getting from input to output.
The AN fields will display as characters so I presume there will be no changes needed there.
The ZD fields will by default display as numeric with leading zeros, e.g. 00100 for a 5-byte ZD field. Do you want them displayed some other way? If so, tell me how you want them displayed (leading spaces?).
The PD fields look suspicious to me. For example, you have:
Code:
ADLINE-ORDNO S9(7) PD 4 7185482
S9(7) would be a 7-byte ZD field, not a 4-byte PD field. S9(7) COMP-3 would be a 4-byte PD field. In hex, a 4-byte PD field would be X'7185482C'. Is that what the fields labelled as PD actually look like in the input file? What do you want displayed in the output file for these fields (leading zeros, leading spaces, ?).
Here's an example with leading spaces displayed to get you started: