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
 

 

Splitting single record in to 2 records based on condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Rambhupalchowdary

New User


Joined: 19 Aug 2010
Posts: 47
Location: Hyderabad

PostPosted: Mon Oct 04, 2010 12:45 pm    Post subject: Splitting single record in to 2 records based on condition
Reply with quote

Hi,

I have an input file of having variable record length 2000, i want to write all the i/p records into outfile( of having fixed length 1000).

we can do this using program also, i want to do this using JCL sort/Icetool.

Please find below example.

1) if the input file have spaces in 1001 to 1010 positions, write only the record from 1 to 1000 positions to o/p file.
2) if the i/p file have any data from 1001 to 1010 positions (atleast any single character in any of these positions), write the record from 1 to 1000 bytes as one record and 1001 to 2000 as another record.

Ram.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Oct 04, 2010 7:36 pm    Post subject:
Reply with quote

Hello,

If all of the input is 2000-byte records, why is the file variable?

If the records are not all 2000, how can it be determined where/how to split the "record"? Code cannot reference byte 1010 if the actual record length is 1000. . .
Back to top
View user's profile Send private message
Rambhupalchowdary

New User


Joined: 19 Aug 2010
Posts: 47
Location: Hyderabad

PostPosted: Tue Oct 05, 2010 12:02 pm    Post subject: Reply to: Splitting single record in to 2 records based on c
Reply with quote

Hi Dick,

thanks for your reply.

Actually maximum input LRECL is 2000 ( VB). so few input records are record length < 1000 and few are > 1000.

suppose if of the input record is 1500 bytes, we need to split it and write as 2 records in output. first 1000 bytes as one record and remaining data as next record.

i got it using below sort card. please check it.

1)First convert Variable to fixed block
OPTION COPY
OUTFIL VTOF,OUTREC=(5,2000)

2)
SORT FIELDS=COPY
OUTFIL IFTHEN=(WHEN=(1001,10,CH,NE,C' '),
BUILD=(1,1000,/,1001,1000)),
IFTHEN=(WHEN=(1001,10,CH,EQ,C' '),
BUILD=(1,1000))

its working.

Ram.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Tue Oct 05, 2010 10:16 pm    Post subject:
Reply with quote

Rambhupalchowdary,
Quote:
Actually maximum input LRECL is 2000

If maximum input LRECL is 2000, then how did you below card working?
Code:
OPTION COPY
OUTFIL VTOF,OUTREC=(5,2000)


Could you post SYSOUT(s) from the steps that ran successfully?

Thanks,
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Oct 05, 2010 10:44 pm    Post subject:
Reply with quote

Hello,

Quote:
its working.
It depends on what is considered "working". . .?
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


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