Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Skipping records
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
sasikumar1984

Active User


Joined: 02 Jul 2007
Posts: 78
Location: Chennai - India

PostPosted: Tue Aug 12, 2008 10:37 pm    Post subject: Skipping records
Reply with quote

Hi I have two files.... Both are created in same program but in different runs, both have header and trailer records... These file are input to next job... I want merge these two files into one file...i want skip header and trailer in second file and insert those records into first file just before first file trailer recods. Please provide me to do this. Actually first file trailer record got number of records, i want change that also. Is it possible changing that value while merging itself?

Please clarify my doubts...

Regards,
Sasikumar.K
Back to top
View user's profile Send private message
References
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 4621
Location: San Jose, CA

PostPosted: Tue Aug 12, 2008 11:27 pm    Post subject:
Reply with quote

You need to give more and clearer information.

Show an example of the records in each input file (relevant fields only) and what you expect for output. Give the RECFM and LRECL of the input files. Give the starting position, length and format of all relevant fields.

Are you "merging" on a key? If so, give the starting position, length and format of the key.

Or are you copying without a key?

Is there anything in the header record that identifies it as a header record (e.g. 'H' in position 1)? If so, what?

Is there anything in the trailer record that identifies it as a trailer record (e.g. 'T' in position 1)? If so, what?
Back to top
View user's profile Send private message
sasikumar1984

Active User


Joined: 02 Jul 2007
Posts: 78
Location: Chennai - India

PostPosted: Wed Aug 13, 2008 7:23 am    Post subject: Merging the files
Reply with quote

Hi Frank,

Thanks for ur reply...

Both the files are created using same program, but in different runs... So both the files record length(1173) and the files record format are same (VB)... Please find below ex for how the files looks....

File1: myfiles.outpu1

kjfhsdkjyfpwfdfnkdfklsdhfsldjhf
kjfsyfduysdfoiysjfsdhfksdhfsdhffsjdhf
uqynwnddskjdhasjdhapduasduapo
dashdjshadljsdhladhdasdaew
triler records ssssssss 4 trailer recrod
triler record end


File 2: myfiles.output2

ehjqwhejkhwkjqnmansasadasdmn
dmsandkjsadkjsdjkdsadasdasdasdsadsd
dsjhadksjhdkjsahdkjsadhkjashdkjs
triler records ssssssss 3 trailer recrod
triler record end

My output should be as below


kjfhsdkjyfpwfdfnkdfklsdhfsldjhf
kjfsyfduysdfoiysjfsdhfksdhfsdhffsjdhf
uqynwnddskjdhasjdhapduasduapo
dashdjshadljsdhladhdasdaew
ehjqwhejkhwkjqnmansasadasdmn
dmsandkjsadkjsdjkdsadasdasdasdsadsd
dsjhadksjhdkjsahdkjsadhkjashdkjs
triler records ssssssss 7 trailer recrod
triler record end


And my output file name should be same as first file nam. i.e myfiles.outpu1

There is no header record. Only trailer record is there.. That can be found using 'ssssssss' in a particular position(say in 37th position and its length is 8).... You can see 4 in first file trailer record and 3 in second file trailer record, my output file record contains 7. I just wanted to add 4 + 3 and write in output file. Becos this number is not total number of records in that file. It comes in different way. So i wanted just to add it.

Please give me some suggestions how to complete this.

Can i use same file name for input and output while merging??
Like below...

Input files : myfiles.outpu1
myfiles.outpu2

Output file: myfiles.outpu1


Regards,
Sasikumar.K
Back to top
View user's profile Send private message
sasikumar1984

Active User


Joined: 02 Jul 2007
Posts: 78
Location: Chennai - India

PostPosted: Wed Aug 13, 2008 7:24 am    Post subject: Sorting
Reply with quote

Frank,

I am not merging the records based on the key... Just wanted to copy both the files and need output as i mentioned in my previous message.

Regards,
Sasikumar.K
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 4621
Location: San Jose, CA

PostPosted: Wed Aug 13, 2008 10:57 pm    Post subject:
Reply with quote

I still have some questions:

You show two 'triler' records in each file. Are there exactly two trailer records in each file and can they be identified by 'triler'? Or are there more than two trailer records in each file? If so, how many (can it vary) and can they all be identified by 'triler'? Is the one with the count the only one with 'ssssssss'?

You show the count in the trailer record you want to replace as one character and don't say where it starts. I assume it's really more than one character, so how long is it, where does it start and what is its format (ZD, PD, something else))?

Quote:
Can i use same file name for input and output while merging??


You are NOT merging, you're copying. And no, you can't use the same file name for input and output while copying or merging.
Back to top
View user's profile Send private message
sasikumar1984

Active User


Joined: 02 Jul 2007
Posts: 78
Location: Chennai - India

PostPosted: Thu Aug 14, 2008 7:26 am    Post subject:
Reply with quote

HI Frank,

Thanks for ur reply....

There will be only two trailer records. Both can be identified 'SSSSSSSS' at position 30 to 37. Only the first trailer record is having the count. So i need to replace that only.

The count starts at 40 to 48 and its PD format (PIC S9(9)).

Please provide me sample code...

Regards,
Sasikumar
Back to top
View user's profile Send private message
arcvns

Senior Member


Joined: 17 Oct 2006
Posts: 802
Location: Chennai, India

PostPosted: Thu Aug 14, 2008 9:39 am    Post subject:
Reply with quote

Sasikumar,

Quote:
The count starts at 40 to 48 and its PD format (PIC S9(9)).


AFAIK, PIC S9(9) in PD format will occupy only 5 bytes and not 9 bytes as your file postions indicate.


Thanks,
Arun
Back to top
View user's profile Send private message
sasikumar1984

Active User


Joined: 02 Jul 2007
Posts: 78
Location: Chennai - India

PostPosted: Thu Aug 14, 2008 11:42 am    Post subject:
Reply with quote

Arun,

Ya it takes 5 bytes... I just gave Eg record like that... instead of in hex format....


Frank,

Any help on this for me??
Back to top
View user's profile Send private message
arcvns

Senior Member


Joined: 17 Oct 2006
Posts: 802
Location: Chennai, India

PostPosted: Thu Aug 14, 2008 11:59 am    Post subject:
Reply with quote

Quote:
The count starts at 40 to 48 and its PD format (PIC S9(9)).


Can you tell where exactly your count starts and where it ends?

Thanks,
Arun
Back to top
View user's profile Send private message
sasikumar1984

Active User


Joined: 02 Jul 2007
Posts: 78
Location: Chennai - India

PostPosted: Thu Aug 14, 2008 3:24 pm    Post subject: Skipping records
Reply with quote

Arun,

Ok, i have given ex like that.. forget abt that...

it starts at 40 and ends at 45 and its PD format.

I just want to merge second file data before the trailer records of the first file and change the trailer record count and eliminate second file trailer.

Please send me sample sort card for this.

Regards,
Sasikumar.K
Back to top
View user's profile Send private message
arcvns

Senior Member


Joined: 17 Oct 2006
Posts: 802
Location: Chennai, India

PostPosted: Thu Aug 14, 2008 7:01 pm    Post subject:
Reply with quote

Sasikumar,

Quote:
There will be only two trailer records. Both can be identified 'SSSSSSSS' at position 30 to 37. Only the first trailer record is having the count


Is there any way to identify the 2nd trailer record. Do the 2nd trailer records for both the files differ?

Thanks,
Arun
Back to top
View user's profile Send private message
sasikumar1984

Active User


Joined: 02 Jul 2007
Posts: 78
Location: Chennai - India

PostPosted: Thu Aug 14, 2008 9:49 pm    Post subject:
Reply with quote

Hi Arun,

Second trailer record also same as first trailer record. Not as i mentioned before. See correct Eg below. I should not reduce the trailer records from two to one. Let it be two itself. But i want change count in it during merging.

File1: myfiles.outpu1

kjfhsdkjyfpwfdfnkdfklsdhfsldjhf
kjfsyfduysdfoiysjfsdhfksdhfsdhffsjdhf
uqynwnddskjdhasjdhapduasduapo
dashdjshadljsdhladhdasdaew
triler records ssssssss 4 trailer recrod
triler records ssssssss 4 trailer recrod


File 2: myfiles.output2

ehjqwhejkhwkjqnmansasadasdmn
dmsandkjsadkjsdjkdsadasdasdasdsadsd
dsjhadksjhdkjsahdkjsadhkjashdkjs
triler records ssssssss 3 trailer recrod
triler records ssssssss 3 trailer recrod

My output should be as below


kjfhsdkjyfpwfdfnkdfklsdhfsldjhf
kjfsyfduysdfoiysjfsdhfksdhfsdhffsjdhf
uqynwnddskjdhasjdhapduasduapo
dashdjshadljsdhladhdasdaew
ehjqwhejkhwkjqnmansasadasdmn
dmsandkjsadkjsdjkdsadasdasdasdsadsd
dsjhadksjhdkjsahdkjsadhkjashdkjs
triler records ssssssss 7 trailer recrod
triler records ssssssss 7 trailer recrod


Please provide sample code, let me try with that and with my own tricks too...
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 4621
Location: San Jose, CA

PostPosted: Thu Aug 14, 2008 10:29 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed that the positions you gave did not count the 4-byte RDW, so the 'SSSSSSSS' identifier actually starts in position 34 and the 6 byte PD count actually starts at position 44.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (VB)
//IN2 DD DSN=...  input file2 (VB)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T2) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:C'1',6:SEQNUM,8,ZD,14:5)),
    IFTHEN=(WHEN=(43,8,CH,EQ,C'ssssssss'),
      OVERLAY=(5:C'9',6:SEQNUM,8,ZD))
/*
//CTL2CNTL DD *
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:C'2',6:SEQNUM,8,ZD,14:5)),
    IFTHEN=(WHEN=(43,8,CH,EQ,C'ssssssss'),
      OVERLAY=(5:C'9',6:SEQNUM,8,ZD))
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN01 DD DSN=&&T1,DISP=(OLD,PASS)
//SORTIN02 DD DSN=&&T2,DISP=(OLD,PASS)
//SORTOUT DD DSN=...  output file (VB)
//SYSIN    DD    *
  MERGE FIELDS=(5,9,ZD,A)
  OPTION EQUALS,VLSHRT
  SUM FIELDS=(53,6,PD)
  OUTFIL BUILD=(1,4,5:14)
/*
Back to top
View user's profile Send private message
sasikumar1984

Active User


Joined: 02 Jul 2007
Posts: 78
Location: Chennai - India

PostPosted: Thu Aug 14, 2008 11:14 pm    Post subject:
Reply with quote

HI Frank,

Thanks for your reply...

I dont think our shop allows to use ICEMAN and ICETOOL.... Becos i have never seen these tools in my productions except in IBM Mainframes... I have been asked to do by using SORT utility..... Can you please tell me how to achieve it by using SORT utility....

Quote:
I assumed that the positions you gave did not count the 4-byte RDW, so the 'SSSSSSSS' identifier actually starts in position 34 and the 6 byte PD count actually starts at position 44.

I really dont understand this...

I said 'SSSSSSSS' is present in both the trailer records, and at postion 40 total number of record count will be there and its in PD format... I really dont know difference between ZD and PD...

And also the code which you gave is very complex for me to understand.... please provide me sample code using SORT utility....
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 4621
Location: San Jose, CA

PostPosted: Thu Aug 14, 2008 11:26 pm    Post subject:
Reply with quote

Quote:
please provide me sample code using SORT utility


I did.

DFSORT is the SORT utility. PGM=SORT and PGM=ICEMAN invoke DFSORT. PGM=ICETOOL invokes DFSORT's ICETOOL utility. If you have DFSORT, then you have ICETOOL (ICETOOL has been shipped with DFSORT since 1991). The job works fine based on the information you gave me. Try the job and see if it works. If it doesn't work, then you didn't give me correct information. If you get error messages, post them.

As for the positions. You said your file is a VB file. Each VB record has an RDW (record descriptor word) in positions 1-4 that gives the length of the record. So the data bytes actually start at position 5, not position 1. So when you said that your field starts in position 30, I assumed you were not counting the RDW in positions 1-4. Thus, we actually have to add 4 for the RDW and your field really starts in position 34.

BTW, I assumed you have 'ssssssss' (lower case) as the identifier as shown in your input record examples. If you actually have 'SSSSSSSS' (upper case) then change 'ssssssss' to 'SSSSSSSS' in the control statements.

Quote:
I really dont know difference between ZD and PD


A PD value would look like this in hex:

dddd...ds

where d is 0-9 and s is the sign (usually C, F or D)

A ZD value would look like this in hex:

FdFd...sd

where again d is 0-9 and s is the sign (usually C, F or D)

If your count field is actually ZD, change PD to ZD in the SUM statement (that's where I'm adding the counts from the trailer records).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 HoursGoto page 1, 2  Next
Page 1 of 2