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
 

 

reformat a VB file in to a different length

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: reformat a VB file in to a different length
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Mar 13, 2008 10:15 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Mar 13, 2008 11:05 pm    Post subject:
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: 500
Location: USA

PostPosted: Fri Mar 14, 2008 1:53 am    Post subject:
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: 500
Location: USA

PostPosted: Fri Mar 14, 2008 1:56 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM 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. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
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 add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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