View previous topic :: View next topic
|
Author |
Message |
naveen_mf
New User
Joined: 15 Jul 2010 Posts: 5 Location: US
|
|
|
|
Hi ,
I am not clear with the GET STRING usage. I searched in manuals , but I could not find much information. Can you please help me on this? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
naveen_mf
New User
Joined: 15 Jul 2010 Posts: 5 Location: US
|
|
|
|
Thank you Dick |
|
Back to top |
|
|
naveen_mf
New User
Joined: 15 Jul 2010 Posts: 5 Location: US
|
|
|
|
This is my input file
Code: |
CUST TYPE
1234567 9406 0
1234567 9406 1
1234567 9406 2
1234567 9406 3
1234567 9406 10
1234567 9406 11
1234567 9406 12
1234567 9406 18
6015154 9406 19
6015154 9406 20
6015154 9406 21
6015154 9406 22 |
I wanna retrieve all records with CUST 1234567(assume that file is sorted) and store it some place and process those records . Later I should switch to 6015154 records for processing ...
I was told that using GET STRING we can get bunch of records based based on key.. but it is not working .. I coded as mentioned below..
READ FILE(SYSIN) INTO (INP);
GET STRING(CUST);
Help me guys.. |
|
Back to top |
|
|
Appu
New User
Joined: 26 Apr 2010 Posts: 73 Location: India
|
|
|
|
Hello Naveen,
Not sure what you are asking about . please see the syntax for GET STRING statement -
GET-STRING (expression) data-specification
From your example, I could only think of the below to get the customer number:
If you have read one record to STR1, then the below statemnet will extract customer number from STR1:
DCL cust_no char(7) init ('');
GET STRING(str1) LIST(cust_no);
let me knw if you have got any other way .
Regards,
Appu |
|
Back to top |
|
|
|