Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to write the missing records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
tarunflash

New User


Joined: 15 Oct 2005
Posts: 25

PostPosted: Sat Dec 10, 2005 9:43 pm    Post subject: How to write the missing records
Reply with quote

i have a file which contains records as below


01 00 001 34
02 00 001 23
03 00 001 34
05 00 001 34
06 00 001 21
07 00 001 21
09 00 001 21 etc


using JCL is there any way to write the missed records (for eg in the above there is 04 & 06) .by using jcl can we write the records in to the output file with all the missed records.

means before writing it has to check whether first column contains records sequentially or not if not it has to write those record also .
Back to top
View user's profile Send private message

Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Sun Dec 11, 2005 4:58 am    Post subject:
Reply with quote

I understand your question like this:

Input:

01 00 001 34
02 00 001 23
03 00 001 34
05 00 001 34
06 00 001 21
07 00 001 21
09 00 001 21

Final output:

01 00 001 34
02 00 001 23
03 00 001 34
04
05 00 001 34
06 00 001 21
07 00 001 21
08
09 00 001 21

if so, here is one way I can think of...

step 1: Create a sequential file with sequence of numbers (to be checked). Say file2:

Eg:
Your input file - File1

01 00 001 34
02 00 001 23
03 00 001 34
05 00 001 34
06 00 001 21
07 00 001 21
09 00 001 21

The file that you create in step 1: - File2

01
02
03
04
05
06
07
08
09

Step 2: Do a Sort - XSUM with file1 and file2 based on first 2 chars (The sequence number). Sortout is the output that you are looking for:

SORTOUT:

01 00 001 34
02 00 001 23
03 00 001 34
04
05 00 001 34
06 00 001 21
07 00 001 21
08
09 00 001 21

Let me know if my understanding is correct....

Rgds,
Ramya
Back to top
View user's profile Send private message
tarunflash

New User


Joined: 15 Oct 2005
Posts: 25

PostPosted: Sun Dec 11, 2005 10:24 am    Post subject: Re: How to write the missing records
Reply with quote

thanks for your reply.ya your understanding is correct but i need missing row should look like as below

04 00 001 00

first two values it should take from previous record and last value should b e zero since it is a missing record.

can u give me the code
Back to top
View user's profile Send private message
Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Mon Dec 12, 2005 12:06 am    Post subject:
Reply with quote

Will all your missing records will have a constant value "00 001 00" from position 4? If so, you just need to change your first step to create the sequence record as below:

01 00 001 00
02 00 001 00
03 00 001 00
04 00 001 00
05 00 001 00
06 00 001 00
07 00 001 00
08 00 001 00
09 00 001 00

You could do this using the following sort card:

SORT FIELDS=COPY
OUTREC FIELDS=(SEQNUM,02,ZD,C' 00 001 00')

if you give 30 empty lines in the input, you'll get 30 records in the output with the above sequence...

Hope this helps.

Ramya
Back to top
View user's profile Send private message
tarunflash

New User


Joined: 15 Oct 2005
Posts: 25

PostPosted: Mon Dec 12, 2005 9:14 pm    Post subject: Re: How to write the missing records
Reply with quote

thanks for your reply.but the program itself should find all the records are in sequential order or not if not it has to write that paticular missed record with the same constant value
Back to top
View user's profile Send private message
tarunflash

New User


Joined: 15 Oct 2005
Posts: 25

PostPosted: Thu Dec 15, 2005 1:17 pm    Post subject: Re: How to write the missing records
Reply with quote

only for the missing records it should contain constant value as
00 001 00
others should contain their old values from the record

eg.
01 00 001 34
02 00 001 23
03 00 001 34
04 00 001 00
05 00 001 34
06 00 001 21
07 00 001 21
08 00 001 00
09 00 001 21


thanks,
tarun
Back to top
View user's profile Send private message
Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Thu Dec 15, 2005 7:07 pm    Post subject: Re: How to write the missing records
Reply with quote

if you do the 2 steps that I've told:

1. Create a sequence file (Used for missing records) as I've told in my previous mail.
2. Do a sort XSUM.

This would give you the result that you are asking for:

01 00 001 34
02 00 001 23
03 00 001 34
04 00 001 00
05 00 001 34
06 00 001 21
07 00 001 21
08 00 001 00
09 00 001 21

Let me know if you tried and it didn't work that way.

Ramya
Back to top
View user's profile Send private message
tarunflash

New User


Joined: 15 Oct 2005
Posts: 25

PostPosted: Fri Dec 16, 2005 10:11 am    Post subject: Re: How to write the missing records
Reply with quote

can i have the code please
Back to top
View user's profile Send private message
tarunflash

New User


Joined: 15 Oct 2005
Posts: 25

PostPosted: Tue Dec 20, 2005 8:17 pm    Post subject: Re: How to write the missing records
Reply with quote

Hi

it is not working.it is writing only if there are two missing records.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us