IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

reformat a VB file in to a different length


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Mar 13, 2008 9:44 pm
Reply with quote

I have a file with length 311.
I have to split this file in to 2 separate files based on the key in the first positions.
This is the i/p file
Code:

1234 asdfgfhnmffhnm
3221 SdfaSGfhdgndgnmxfgnh
1234SgfSGhgd
3221asdafasdfs


first o/p file should contain,that is only the records having the KEY value 1234
Code:

1234 asdfgfhnmffhnm
1234SgfSGhgd


second o/p file should have, the records which have the key value
Code:

3221 SdfaSGfhdgndgnmxfgnh
3221asdafasdfs


In my real scenario i have to create 3 o/p files based on the keys. What ever i have shown here is an example only.
I am facing difficulties because of RDW. please help me...
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Mar 13, 2008 9:49 pm
Reply with quote

sorry i missed the main part of my problem...
the output file should have key value at all
the file 1 should look like

Code:

 asdfgfhnmffhnm
SgfSGhgd


file 2 shd look like
Code:

 SdfaSGfhdgndgnmxfgnh
asdafasdfs
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Mar 13, 2008 9:53 pm
Reply with quote

the i/p file format is VB and lrecl is 311
the 1st o/p file is VB and lrecl 50
2nd o/p file is VB and lrecl 90
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Mar 13, 2008 10:15 pm
Reply with quote

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

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB/311)
//OUT1 DD LRECL=50,DSN=...  output file1 (VB/50)
//OUT2 DD LRECL=90,DSN=...  output file2 (VB/90)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=OUT1,
    INCLUDE=(5,4,CH,EQ,C'1234'),
    BUILD=(1,4,5:9)
  OUTFIL FNAMES=OUT2,
    INCLUDE=(5,4,CH,EQ,C'3221'),
    BUILD=(1,4,5:9)
/*
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Mar 13, 2008 10:56 pm
Reply with quote

I get the error
Code:
OUT1     HAS INCOMPATIBLE LRECL

is there anything to do with NOSOLRF or some thing...
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Mar 13, 2008 11:05 pm
Reply with quote

That's a Syncsort message.

I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Mar 14, 2008 1:53 am
Reply with quote

krisprems,

Try this:
Code:
//SYSIN    DD    *                   
    SORT FIELDS=COPY                 
    OUTFIL FILES=01,                 
      INCLUDE=(5,4,CH,EQ,C'1234'),   
      IFTHEN=(WHEN=(1,2,BI,LT,54),   
      BUILD=(1,4,9)),IFOUTLEN=50,   
      IFTHEN=(WHEN=(1,2,BI,GE,54),   
      BUILD=(1,4,9,46))             
    OUTFIL FILES=02,                 
      INCLUDE=(5,4,CH,EQ,C'3221'),   
      IFTHEN=(WHEN=(1,2,BI,LT,94),   
      BUILD=(1,4,9)),IFOUTLEN=90,   
      IFTHEN=(WHEN=(1,2,BI,GE,94),   
      BUILD=(1,4,9,86))     
/*
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Mar 14, 2008 1:56 am
Reply with quote

krisprems,

Please note, if you are using my control cards as is, you'll need to change the OUT1 and OUT2 DDs to SORTOF01 and SORTOF02.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Mar 14, 2008 1:29 pm
Reply with quote

Thanks Frank and Alissa.
Alissa: i used ur sort card, it worked for me...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top