i have two files. one is VSAM and another onc is flat GDG file. i want the out put file with using these two files which i explained below.i have to do this using any JCL utilities with out write any new program. please help me write a JCL step for this.
i have two files one is VSAM(v.v.v) and another is GDG file (g.g.g(0))
(legends:
reqfiled = Required field from VSAM to OUTPUT FILE.
DATA1 = Data in VSAM
DATA = Data in GDG (in vsam data and GDG data are different, only key fields are same))
1)in VSAM file the length is 383 and it indexed seq file. First three fields are comb key fields. like
Keyfield2 and keyfield3 are BINARY format fields. remaining are CHAR format.
records are like in VSAM
========================
AAA111222DATAa.......REQaDATAz........REQzDATA
AAA222222DATAb.......REQbDATAy........REQyDATA
AAA111333DATAc.......REQcDATAx........REQxDATA
BBB111222DATAd.......REQdDATAw........REQwDATA
:
:
:
:
ZZZ111222DATAz.......REQ1DATAa........REQ2DATA
3)I want the output file like..(reqfield1,reqfield2 needs to be populate from vsam file)
1-----------------------------------------------101(starts SPACES),102(starts reqfield1 and continues reqfield2 and SPACES)-----------------------------454
keyfild1,|,keyfiled2,|,keyfield3,|,DATA.............reqfield1,reqfield2,SPACES......
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Nath,
I still need some clarification.
1. what is the cobol definitions for keyfild1,keyfiled2,keyfield3 in vsam file and what are postions of these fields in the vsam file.
2. Can the combo of keyfild1,keyfiled2,keyfield3 in the VSAM file have dups? If it has then from which dup record do we need to be pick the required fields data?
3. what is the cobol definitions for keyfild1,keyfiled2,keyfield3 in GDG file and what are postions of these fields in the GDG file?
4. Can the combo of keyfild1,keyfiled2,keyfield3 in the GDG file have dups? if so do you need the duplicates to be retained?
5. Do you want the output file to be a VB file or FB file?
in this keyfield2 anad keyfield3 are not have fixed positions per each record. it vary by '|' symbole like ...
(please see the first three fields in each records. above i have give only the max length for these three keyfields)
AAA|222|222|DATA..................SPACES........................................
BBB|1111|222|DATA..................SPACES........................................
AAA|111|3331|DATA..................SPACES........................................
in this we duplicate combination keys..but this is just only GDG file.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Nath,
The vsam file key has two 4 byte binary fields as part of the key. A 4 byte binary field is stored in a full word and it can store values ranging from -2,147,483,648 through +2,147,483,647.
The corresponding key in GDG is only 4 byte numeric which would only store a max of 9999. Now what happens if the vsam key has a value greater than 9999 ?
Also what is the length and pos of the required data1 & dat2 to be pulled from the vsam file.