Using fromdsn in a loop?

General discussion of the Co:Z Toolkit
Post Reply
usaajrm
Posts: 87
Joined: Tue Feb 06, 2007 3:46 pm

Using fromdsn in a loop?

Post by usaajrm »

With my problems behind me, I'm writing a bash srcipt (first one). I want to process the records in an MVS dataset. Are there any examples of using a loop? I didn't want to write a script to execute fromdsn and pipe it to another script, which is what I see in the docs examples.[/code]
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

Try this:

Code: Select all

 fromdsn DD:INPUT | 
 while read line
 do
    echo $line
 done
usaajrm
Posts: 87
Joined: Tue Feb 06, 2007 3:46 pm

Post by usaajrm »

Works great. Thank you.
usaajrm
Posts: 87
Joined: Tue Feb 06, 2007 3:46 pm

Post by usaajrm »

I wish to reciporcate. After using your suggestion, I found this also works. Thanks again.
while read line
do
array[$i]="$line"
printf "%s\n" "$array[$i]"
((i++))
done < <(fromdsn '//A.DATA.SET(MEMBER)')
Post Reply