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
 

 

Check if a field is empty.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
machswap

New User


Joined: 19 Apr 2005
Posts: 14

PostPosted: Wed Aug 17, 2005 12:09 pm    Post subject: Check if a field is empty.
Reply with quote

I have a requirement where a file is of lrecl = 1500,
i have to check if a partucular field is empty and if it's empty I have to populate that field by some default value else I have to leave as it is

eg:
fld1 field2 ...........
suppose field2 is empty I have to populate it with some default value, else
if it has some value, leave as it is.
Back to top
View user's profile Send private message

mainframesguru

New User


Joined: 24 Jun 2005
Posts: 36
Location: Hyderabad

PostPosted: Wed Aug 17, 2005 12:51 pm    Post subject:
Reply with quote

Hi

This is possible using SORT with INREC.
Please refer following piece of code:
Code:

----------------------------------------------------------------
INREC FIELDS=(1,9,10,1,                               
              CHANGE=(1,C' ',C'U'),NOMATCH=(10,1),     
              11,69)
----------------------------------------------------------------


1. This code, will not change 1-9 bytes.
2. At 10th byte,with length 1, if the byte is " "(space), make it "U",
otherwise it will be as it was before
3. Rest of the bytes from 11 to end will be same.

If you have any more doubts, revert back

Thanks And Regards
Vamshi
Back to top
View user's profile Send private message
machswap

New User


Joined: 19 Apr 2005
Posts: 14

PostPosted: Wed Aug 17, 2005 2:52 pm    Post subject: Re: jcl - urgent
Reply with quote

Hi VAmshi,

Thanks a lot for ur help
onoe doubt
Posted: Wed Aug 17, 2005 12:21 pm Post subject:

--------------------------------------------------------------------------------

Hi

INREC FIELDS=(1,9,10,1,
CHANGE=(1,C' ',C'U'),NOMATCH=(10,1),
11,69)
----------------------------------------------------------------

here what is the limit po length of the field that is going to be replaced
eg. u r replacing by 'u' which is of length 1, can the length of the field, be 100. I think the limit is only 64.

In my cazse:
my field that is to be replaced is of length 100 chars.
so,
INREC FIELDS=(1,9,10,1,
CHANGE=(100,C' ',C'default value'),NOMATCH=(10,100),
11,69)

Please let me know ur suggestion and comments
----------------------------------------------------------------
Back to top
View user's profile Send private message
mainframesguru

New User


Joined: 24 Jun 2005
Posts: 36
Location: Hyderabad

PostPosted: Wed Aug 17, 2005 6:42 pm    Post subject: Re: Check if a field is empty.
Reply with quote

Hi,

Sorry, I dont have answer for your question,about replacing by 100
characters.

Can you please let me know, how you are going to give 100 characters
default value in 80 Record-Length JCL.

Thanks And Regards
Vamshi
ICC-ISH
Chennai
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm


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