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
 

 

Validate the data and write

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

New User


Joined: 05 Jun 2008
Posts: 17
Location: chennai

PostPosted: Mon Jun 23, 2008 11:21 am    Post subject: Validate the data and write
Reply with quote

Hi,

I have the requirement like below

I have the input file , in that i have the fileds like lastname,firstname,
PBP etc...
Now i need to check the input file whether any value is there in lastname other wise i need to move spaces and another condition is
if PBP >800 ,then i need to move as 'Group', if it is <800
need to move as 'individual' .

Basically here i need to validate the data after that i need to write to
output file.

Could you please suggest how we can write using SORT.

Thanks,
Srinivas
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 Jun 23, 2008 11:47 am    Post subject:
Reply with quote

Hello Kasu and welceom to the forums,

Quote:
Now i need to check the input file whether any value is there in lastname other wise i need to move spaces
Please clarify what this means. . . If there is not "any value" would it not already be spaces?

You need to post the definiton of your input and output. Show a few input sample records and the output you want from these records.

Please include the recfm and lrecl for each file.
Back to top
View user's profile Send private message
srinivas_cog

New User


Joined: 05 Jun 2008
Posts: 17
Location: chennai

PostPosted: Mon Jun 23, 2008 12:08 pm    Post subject:
Reply with quote

Hi D.sch Thanks for your replay.

Please clarify what this means. . . If there is not "any value" would it not already be spaces? Yes, it is a spaces.So i can move what ever is there in input.

Input:
lastname Firstname pbp date
abcd efgh 850 12022008

Output :

Lastname firstname sector date
abcd efgh Group(pbp>800) 12022008

Both input and output files are fixed record lenghts.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Jun 23, 2008 9:28 pm    Post subject:
Reply with quote

srinivas_cog,

The following DFSORT JCL will give you the desired results. I assumed that the PBP field to be validated starts at position 20 for 3 bytes.

Code:

//STEP0100 EXEC PGM=ICEMAN                                 
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                             
ABCD     EFGH      850  12022008                           
DEFG     EFGH      350  12022008                           
XYZA     EFGH           12022008                           
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                         
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(35:C'INDIVIDUAL')),     
  IFTHEN=(WHEN=(20,3,ZD,GT,800),OVERLAY=(35:C'GROUP     '))
/*                                                         


The output from this job is
Code:

ABCD     EFGH      850  12022008  GROUP     
DEFG     EFGH      350  12022008  INDIVIDUAL
XYZA     EFGH           12022008  INDIVIDUAL


Hope this helps...

Cheers
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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
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 Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am


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