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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm


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