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 Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm


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