Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
hi there,
I have a requirement to isolate to a separate file all 'new' projects that have been added to our system since the last time we ran an SAP database load. The data that comprises a project has items / keys that start in column 1 at 000 as the 'project to start record' then 100, 200, 300, 400 etc that make up the pieces of the project's task's. Since there can be any number of 100 , 200 etc records I am needing to get all of the keys between the 000 project description record and the next 000 record.
Data looks like:
madmartinsonxx,
Do you have limit to maximum number of projects? By 1st add and 2nd add did you mean to write them to separate mainframe files.
Are you trying to create separate output files by splitting your input file, based on project.
Also, you show different input data in one post and and later in the next one you are showing expected output based on completely different input data.
Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
sql,
right. didnt see the data anomally there. same input file though. and no i do not need separate files. just the 'new' project set of data, no matter how many there, written to one output file so the business guy can su** it up into a spreadsheet. 1st add and 2nd add was example to show that there could be several 100's , 200's 300's etc.
i will need to look at this PUSH=(81:ID=8)) to understand its implication. appears to be similiar to SEQNUM, but, i am just not sure. The BEGIN keyword rings a bell soundly though. That is something I will remember.
Cant golf today and this task is what my next step is in this lovely conversion mess and Thanks mucho again.
just the 'new' project set of data, no matter how many there, written to one output file so the business guy can suc* it up into a spreadsheet.
I am not sure what do you mean 'new' project set of data?
Quote:
i will need to look at this PUSH=(81:ID=8)) to understand its implication. appears to be similiar to SEQNUM, but, i am just not sure. The BEGIN keyword rings a bell soundly though. That is something I will remember.
PUSH is not simiar to SEQNUM except both are ZD. PUSH works at a group level and SEQNUM at a record level. In layman's terms, it basically assings unique id to each group (and to records which forms the group). Through BEGIN and END you define group.
Escapa,
Just for fun, I am wondering what would EQUALS do with OPTION COPY.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
madmartinsonxx,
You need to explain what you mean by a "new project set of data". What are the programmatic rules for identify the groups of data you want vs the groups of data you don't want?
PUSH has several options that apply to the identified group. ID=n puts the same number in each record of the group (e.g. 0001 for all records of first group, 0002 for all records of second group, etc). SEQ=n puts a sequence number in each record of each group (e.g. 0001 for first record of first group, 0002 for second record of first group,...,0001 for first record of second group, 0002 for second record of second group, etc).
Quote:
Just for fun, I am wondering what would EQUALS do with OPTION COPY.
As you probably know, EQUALS is ignored with COPY since it has no meaning for COPY.
Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
Quote:
You need to explain what you mean by a "new project set of data".
Good question. Thank you, my bad.
I have 2 files of same layout and lrecl (as above). F1 has last weeks projects set's of data. F2 has the F1 data records AND new projects which were entered data records. The 000 in column 1 is the start of a project's set of data. If the 000 record is in F2ONLY then it is considered an ADD / NEW project along with it's associated data 100, 200 etc records.
If i had another field which i could KEY off of along with the 000, 100 KEY I would be in fat city. But, I don't. Thats why the inquiry into the GROUP function which I felt was appropriate.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
mad,
You never mentioned that you have two files before. That's different and we still don't have a clear picture of what you're trying to do.
So please start over and give a better explanation and example of what you need.
Show an example of the records in each input file (relevant fields only) and what you expect for output. 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 files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
Quote:
What makes project unique? Do you have something like unique project id?
recfm=fb, lrecl=133
what makes project unique is that the entire 000 record, all 133 bytes, that appears in F2 does not exist in F1 at all. When that flag is raised all of the other 100, 200 etc records are a part of the NEW 000 record until I get the next 000 record then the party starts anew.[/quote]