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 the file

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

New User


Joined: 16 Sep 2008
Posts: 72
Location: Bangalore

PostPosted: Thu Mar 04, 2010 12:19 pm    Post subject: Splitting the file
Reply with quote

The I/P file contains the records in the following format :
Code:
A1234A1
B0000B1
C  12C1
D    D1
E0000E1
F0   F1

We have to split the file based on the cols 2 to 5 (Starting Position =2, Length =4).
If Cols 2 to 5 is > 0, then write in the 1st file
If Cols 2 to 5 is =< 0, then write in the 2nd file.

I have run the SORT step by using the following sort card :

SORT FIELDS=COPY
OUTFIL FILES=1,INCLUDE=(2,4,CH,GT,C'0000')
OUTFIL FILES=2,INCLUDE=(2,9,CH,LE,C'0000').

Now the 3rd record (Starting from 'C' ) is greater than 0, but still its coming in the 2nd file.

Can anyone please suggest me how to solve this problem?
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 04, 2010 12:28 pm    Post subject:
Reply with quote

Why are there differences in the length being compared between the two OUTFIL statements.
Back to top
View user's profile Send private message
Debasis Misra
Warnings : 1

New User


Joined: 16 Sep 2008
Posts: 72
Location: Bangalore

PostPosted: Thu Mar 04, 2010 12:35 pm    Post subject:
Reply with quote

Really Sorry!

Modifying the sort card :

SORT FIELDS=COPY
OUTFIL FILES=1,INCLUDE=(2,4,CH,GT,C'0000')
OUTFIL FILES=2,INCLUDE=(2,4,CH,LE,C'0000').

Giving same problem still.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 04, 2010 12:51 pm    Post subject:
Reply with quote

Looking at the hex / binary representations

C'0' is 'F0'X is '11110000'B
space is '40'X is '01000000'B

During your comparison the full four bytes of the control will be
'11110000111100001111000011110000' but the first byte as a space will give
'01000000........................' which is less than the control of C'0000'.

Maybe ALTSEQ will help you to convert the space to zero.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Mar 04, 2010 1:00 pm    Post subject:
Reply with quote

Below sortcard will give you desired output..
Code:

//S1    EXEC  PGM=SORT                             
//SORTIN DD *                                       
A1234A1                                             
B0000B1                                             
C  12C1                                             
D    D1                                             
E0000E1                                             
F    F1                                             
//SORTOF01 DD SYSOUT=*                             
//SORTOF02 DD SYSOUT=*                             
//SYSOUT    DD  SYSOUT=*                           
//SYSIN    DD  *                                   
  SORT FIELDS=COPY                                 
  OUTFIL FNAMES=SORTOF01,INCLUDE=(2,4,UFF,GT,0)     
  OUTFIL FNAMES=SORTOF02,SAVE                       
/*                                                 
Back to top
View user's profile Send private message
Debasis Misra
Warnings : 1

New User


Joined: 16 Sep 2008
Posts: 72
Location: Bangalore

PostPosted: Thu Mar 04, 2010 1:06 pm    Post subject:
Reply with quote

Its working!!!!
Thanks a lot !!!
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Mar 04, 2010 1:09 pm    Post subject:
Reply with quote

Debasis Misra wrote:
Its working!!!!
Thanks a lot !!!

I am Glad. icon_smile.gif
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Mar 04, 2010 1:33 pm    Post subject:
Reply with quote

Debasis Misra wrote:
If Cols 2 to 5 is > 0, then write in the 1st file
If Cols 2 to 5 is =< 0, then write in the 2nd file.
Why are you comparing an alphanumeric field with what is basicly a numeric oprand?
The leading blanks will always be lower than any numeric or alphabetic characters.

Sambhaji wrote:
Below sortcard will give you desired output..
[code] OUTFIL FNAMES=SORTOF01,INCLUDE=(2,4,UFF,GT,0)
Since the field specified is not numeric, what will DFSort do with it if there were no numerics and one or more alpha characters in it?
Since USS ignores any sign representation, maybe SFF might be better (assuming that field can ever be negative and less than C'0000'.....
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Mar 04, 2010 2:59 pm    Post subject: Reply to: Splitting the file
Reply with quote

Yes CICS Guy,
You are right, if negative values are present then SFF should be used.
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: Thu Mar 04, 2010 8:53 pm    Post subject:
Reply with quote

Hello,

OK for the values that are "numeric" but what about:
Quote:
Since the field specified is not numeric, what will DFSort do with it if there were no numerics and one or more alpha characters in it?
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 04, 2010 11:23 pm    Post subject:
Reply with quote

Quote:
Since the field specified is not numeric, what will DFSort do with it if there were no numerics and one or more alpha characters in it?


With UFF or SFF format, DFSORT would treat the value as 0 in this case.
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. 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