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 a record into multiple records using the key value

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

New User


Joined: 24 Feb 2006
Posts: 18
Location: Chennai

PostPosted: Fri Jul 03, 2009 12:47 pm    Post subject: Splitting a record into multiple records using the key value
Reply with quote

Hi,

I have the following input file of lrecl 451 and recfm VB

The first byte will have value from 0 to 9. Based on the value of first byte, the record length will vary.

If the first byte is 0, then the recl is 1; if 1 then recl is 51; if 2 recl is 101; if 3 recl is 151 ... if 9 recl is 451. (In simple words, the first byte identifies the number of occurences in the record)

Now my requirement is if first byte is 0, do not write the record to output. If first byte is 1, write one record to output from 2 to 51 bytes from input.
If first byte is 2, write two records to output from 2 to 51 bytes as 1 record and 52 to 101 as second record from input and so on.
My output will have lrecl 50 and recfm FB

Can you please tell me whether it's possible using DFSORT and if yes, the solution please
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


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

PostPosted: Fri Jul 03, 2009 7:59 pm    Post subject:
Reply with quote

Quote:
I have the following input file of lrecl 451 and recfm VB

If the first byte is 0, then the recl is 1; if 1 then recl is 51


Which type of 0? C'0', X'00', something else?

Your description of the records does not match your statement that the RECFM is VB. A VB record has a 4-byte RDW, so the minimum LRECL and record length is 5, not 1. The LRECL must be large enough to contain the largest record.

Do you really mean:

If the fifth byte is 0, then the record length is 5; if 1 then record length is 55?

Or does your input file actually have RECFM=FB?

You can do what you want with DFSORT either way, but I need to know what your input file really looks like to give you the correct solution.

Note that for technical discussions, it's important to use the correct terminology so people understand what you mean.
Back to top
View user's profile Send private message
Parthasarathy

New User


Joined: 24 Feb 2006
Posts: 18
Location: Chennai

PostPosted: Mon Jul 06, 2009 10:48 am    Post subject: Reply to: Splitting a record into multiple records using the
Reply with quote

Hi Yaeger,

I need the soultion for the following scenario as my input file is VB (Apologies for the confusion). And the zero is of type C'0'.

Quote:
Do you really mean:

If the fifth byte is 0, then the record length is 5; if 1 then record length is 55?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Mon Jul 06, 2009 9:50 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file (VB/455)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/50)
//TOOLIN   DD    *
COPY FROM(IN) USING(CTL1)
COPY FROM(T1) USING(CTL2)
/*
//CTL1CNTL DD *
  OMIT COND=(5,1,CH,EQ,C'0')
  OUTFIL FNAMES=T1,VTOF,BUILD=(5,451)
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=OUT,IFOUTLEN=50,
   IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),
    BUILD=(2,50)),
   IFTHEN=(WHEN=(1,1,CH,EQ,C'2'),
    BUILD=(2,50,/,52,50)),
   IFTHEN=(WHEN=(1,1,CH,EQ,C'3'),
    BUILD=(2,50,/,52,50,/,102,50)),
   IFTHEN=(WHEN=(1,1,CH,EQ,C'4'),
    BUILD=(2,50,/,52,50,/,102,50,/,152,50)),
   IFTHEN=(WHEN=(1,1,CH,EQ,C'5'),
    BUILD=(2,50,/,52,50,/,102,50,/,152,50,/,
           202,50)),
   IFTHEN=(WHEN=(1,1,CH,EQ,C'6'),
    BUILD=(2,50,/,52,50,/,102,50,/,152,50,/,
           202,50,/,252,50)),
   IFTHEN=(WHEN=(1,1,CH,EQ,C'7'),
    BUILD=(2,50,/,52,50,/,102,50,/,152,50,/,
           202,50,/,252,50,/,302,50)),
   IFTHEN=(WHEN=(1,1,CH,EQ,C'8'),
    BUILD=(2,50,/,52,50,/,102,50,/,152,50,/,
           202,50,/,252,50,/,302,50,/,352,50)),
   IFTHEN=(WHEN=(1,1,CH,EQ,C'9'),
    BUILD=(2,50,/,52,50,/,102,50,/,152,50,/,
           202,50,/,252,50,/,302,50,/,352,50,/402,50))
/*
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 Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 4 Mon Mar 27, 2017 3:59 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am


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